Fixed: AAPT error in nightly, and standalone APK.

* Improved the including of modules in variant.
This commit is contained in:
MohitMaliFtechiz 2025-08-27 13:29:14 +05:30 committed by Kelson
parent 1d175b9437
commit 7e71dc44df
5 changed files with 7 additions and 10 deletions

View File

@ -133,8 +133,7 @@ dependencies {
// inject migration module in test cases. // inject migration module in test cases.
androidTestImplementation(project(":objectboxmigration")) androidTestImplementation(project(":objectboxmigration"))
// inject default module for all variant. // inject default module for all variant.
debugImplementation(project(":defaultmigration")) implementation(project(":defaultmigration"))
releaseImplementation(project(":defaultmigration"))
// inject migration module in playStore variant. // inject migration module in playStore variant.
add("playStoreImplementation", project(":objectboxmigration")) add("playStoreImplementation", project(":objectboxmigration"))
} }

View File

@ -23,7 +23,7 @@ import org.kiwix.kiwixmobile.di.components.KiwixActivityComponent
import org.kiwix.kiwixmobile.di.components.KiwixComponent import org.kiwix.kiwixmobile.di.components.KiwixComponent
import org.kiwix.kiwixmobile.main.KiwixMainActivity import org.kiwix.kiwixmobile.main.KiwixMainActivity
val BaseActivity.kiwixComponent: KiwixComponent private val BaseActivity.kiwixComponent: KiwixComponent
get() = kiwixApp()?.kiwixComponent ?: throw RuntimeException( get() = kiwixApp()?.kiwixComponent ?: throw RuntimeException(
""" """
applicationContext is ${applicationContext::class.java.simpleName} applicationContext is ${applicationContext::class.java.simpleName}

View File

@ -59,12 +59,12 @@ import kotlinx.coroutines.flow.collectLatest
import kotlinx.coroutines.flow.filterNotNull import kotlinx.coroutines.flow.filterNotNull
import kotlinx.coroutines.launch import kotlinx.coroutines.launch
import org.kiwix.kiwixmobile.BuildConfig import org.kiwix.kiwixmobile.BuildConfig
import org.kiwix.kiwixmobile.KiwixApp
import org.kiwix.kiwixmobile.R import org.kiwix.kiwixmobile.R
import org.kiwix.kiwixmobile.core.CoreApp import org.kiwix.kiwixmobile.core.CoreApp
import org.kiwix.kiwixmobile.core.R.drawable import org.kiwix.kiwixmobile.core.R.drawable
import org.kiwix.kiwixmobile.core.R.mipmap import org.kiwix.kiwixmobile.core.R.mipmap
import org.kiwix.kiwixmobile.core.R.string import org.kiwix.kiwixmobile.core.R.string
import org.kiwix.kiwixmobile.core.base.BaseActivity
import org.kiwix.kiwixmobile.core.base.FragmentActivityExtensions import org.kiwix.kiwixmobile.core.base.FragmentActivityExtensions
import org.kiwix.kiwixmobile.core.dao.LibkiwixBookOnDisk import org.kiwix.kiwixmobile.core.dao.LibkiwixBookOnDisk
import org.kiwix.kiwixmobile.core.downloader.downloadManager.DOWNLOAD_NOTIFICATION_TITLE import org.kiwix.kiwixmobile.core.downloader.downloadManager.DOWNLOAD_NOTIFICATION_TITLE
@ -83,7 +83,6 @@ import org.kiwix.kiwixmobile.core.reader.ZimReaderSource
import org.kiwix.kiwixmobile.core.utils.LanguageUtils.Companion.handleLocaleChange import org.kiwix.kiwixmobile.core.utils.LanguageUtils.Companion.handleLocaleChange
import org.kiwix.kiwixmobile.core.utils.dialog.DialogHost import org.kiwix.kiwixmobile.core.utils.dialog.DialogHost
import org.kiwix.kiwixmobile.kiwixActivityComponent import org.kiwix.kiwixmobile.kiwixActivityComponent
import org.kiwix.kiwixmobile.kiwixComponent
import org.kiwix.kiwixmobile.ui.KiwixDestination import org.kiwix.kiwixmobile.ui.KiwixDestination
import javax.inject.Inject import javax.inject.Inject
@ -182,7 +181,7 @@ class KiwixMainActivity : CoreMainActivity() {
// run the migration on background thread to avoid any UI related issues. // run the migration on background thread to avoid any UI related issues.
CoroutineScope(Dispatchers.IO).launch { CoroutineScope(Dispatchers.IO).launch {
if (!sharedPreferenceUtil.prefIsTest) { if (!sharedPreferenceUtil.prefIsTest) {
(this as BaseActivity).kiwixComponent (applicationContext as KiwixApp).kiwixComponent
.provideObjectBoxDataMigrationHandler() .provideObjectBoxDataMigrationHandler()
.migrate() .migrate()
} }

View File

@ -24,7 +24,7 @@ import androidx.annotation.IdRes
import org.kiwix.kiwixmobile.core.base.BaseActivity import org.kiwix.kiwixmobile.core.base.BaseActivity
import org.kiwix.kiwixmobile.custom.di.CustomComponent import org.kiwix.kiwixmobile.custom.di.CustomComponent
val BaseActivity.customComponent: CustomComponent private val BaseActivity.customComponent: CustomComponent
get() = customApp()?.customComponent ?: throw RuntimeException( get() = customApp()?.customComponent ?: throw RuntimeException(
""" """
applicationContext is ${applicationContext::class.java.simpleName} applicationContext is ${applicationContext::class.java.simpleName}

View File

@ -37,7 +37,6 @@ import kotlinx.coroutines.launch
import org.kiwix.kiwixmobile.core.CoreApp import org.kiwix.kiwixmobile.core.CoreApp
import org.kiwix.kiwixmobile.core.R.drawable import org.kiwix.kiwixmobile.core.R.drawable
import org.kiwix.kiwixmobile.core.R.string import org.kiwix.kiwixmobile.core.R.string
import org.kiwix.kiwixmobile.core.base.BaseActivity
import org.kiwix.kiwixmobile.core.extensions.browserIntent import org.kiwix.kiwixmobile.core.extensions.browserIntent
import org.kiwix.kiwixmobile.core.main.ACTION_NEW_TAB import org.kiwix.kiwixmobile.core.main.ACTION_NEW_TAB
import org.kiwix.kiwixmobile.core.main.CoreMainActivity import org.kiwix.kiwixmobile.core.main.CoreMainActivity
@ -48,9 +47,9 @@ import org.kiwix.kiwixmobile.core.main.NEW_TAB_SHORTCUT_ID
import org.kiwix.kiwixmobile.core.reader.ZimReaderSource import org.kiwix.kiwixmobile.core.reader.ZimReaderSource
import org.kiwix.kiwixmobile.core.utils.dialog.DialogHost import org.kiwix.kiwixmobile.core.utils.dialog.DialogHost
import org.kiwix.kiwixmobile.custom.BuildConfig import org.kiwix.kiwixmobile.custom.BuildConfig
import org.kiwix.kiwixmobile.custom.CustomApp
import org.kiwix.kiwixmobile.custom.R import org.kiwix.kiwixmobile.custom.R
import org.kiwix.kiwixmobile.custom.customActivityComponent import org.kiwix.kiwixmobile.custom.customActivityComponent
import org.kiwix.kiwixmobile.custom.customComponent
class CustomMainActivity : CoreMainActivity() { class CustomMainActivity : CoreMainActivity() {
override val mainActivity: AppCompatActivity by lazy { this } override val mainActivity: AppCompatActivity by lazy { this }
@ -88,7 +87,7 @@ class CustomMainActivity : CoreMainActivity() {
// run the migration on background thread to avoid any UI related issues. // run the migration on background thread to avoid any UI related issues.
CoroutineScope(Dispatchers.IO).launch { CoroutineScope(Dispatchers.IO).launch {
if (!sharedPreferenceUtil.prefIsTest) { if (!sharedPreferenceUtil.prefIsTest) {
(this as BaseActivity).customComponent (applicationContext as CustomApp).customComponent
.provideObjectBoxDataMigrationHandler() .provideObjectBoxDataMigrationHandler()
.migrate() .migrate()
} }