Status Update
Comments
si...@gmail.com <si...@gmail.com> #2
As you can see I added line -ignorewarning
in proguard-rules.pro
It because without this build failed and in mapping.txt will be so many files that recommended to add in proguard-rules.pro
.
For example there is a few of warnings:
Missing class my.project.config.BuildInfoProvider (referenced from: java.lang.Object my.project.new.DaggerMyApp_HiltComponents_SingletonC$SingletonCImpl$SwitchingProvider.get() and 4 other contexts)
Missing class my.project.config.BuildResourceProvider (referenced from: java.lang.Object my.project.new.DaggerMyApp_HiltComponents_SingletonC$SingletonCImpl$SwitchingProvider.get() and 4 other contexts)
Missing class my.project.core.navigation.BottomNavigationScreen$BaseCatalogScreen (referenced from: void my.project.new.ui.navigation.BottomBarKt.<clinit>() and 1 other context)
Missing class my.project.core.navigation.BottomNavigationScreen$CartScreen (referenced from: void my.project.new.ui.navigation.BottomBarKt.<clinit>() and 1 other context)
Missing class my.project.core.navigation.BottomNavigationScreen$CatalogScreen (referenced from: kotlin.Unit my.project.new.ui.main.MainScreenKt$MainScreen$6$1$3.invoke$lambda\$40$lambda$12$lambda$11$lambda$10$lambda$9(androidx.navigation.NavController, my.project.feature_catalog_api.domain.models.NewCategoryDto) and 2 other contexts)
Missing class my.project.core.navigation.BottomNavigationScreen$FavouritesScreen (referenced from: void my.project.new.ui.navigation.BottomBarKt.<clinit>() and 1 other context)
Missing class my.project.core.navigation.BottomNavigationScreen$MainScreen (referenced from: void my.project.new.ui.navigation.BottomBarKt.<clinit>() and 2 other contexts)
Missing class my.project.core.navigation.BottomNavigationScreen$ProfileScreen (referenced from: void my.project.new.ui.navigation.BottomBarKt.<clinit>() and 1 other context)
Missing class my.project.core.navigation.ExtensionsKt (referenced from: kotlin.Unit my.project.new.ui.main.MainScreenKt$MainScreen$6$1$3.invoke$lambda$40$lambda$12$lambda$11$lambda$10$lambda$9(androidx.navigation.NavController, my.project.feature_catalog_api.domain.models.NewCategoryDto) and 1 other context)
Missing class my.project.core.navigation.RootScreen$Cart (referenced from: void my.project.new.ui.navigation.BottomBarKt.<clinit>() and 1 other context)
Missing class my.project.core.navigation.RootScreen$Catalog (referenced from: void my.project.new.ui.navigation.BottomBarKt.<clinit>() and 1 other context)
Missing class my.project.core.navigation.RootScreen$Favourites (referenced from: void my.project.new.ui.navigation.BottomBarKt.<clinit>() and 1 other context)
Missing class my.project.core.navigation.RootScreen$Main (referenced from: void my.project.new.ui.navigation.BottomBarKt.<clinit>() and 2 other contexts)
Missing class my.project.core.navigation.RootScreen$Profile (referenced from: void my.project.new.ui.navigation.BottomBarKt.<clinit>() and 1 other context)
Missing class my.project.core.navigation.RootScreen (referenced from: my.project.core.navigation.RootScreen my.project.new.ui.navigation.BottomBarKt$BottomBar$5$1$1$1$2$1$2$1.$screen and 9 other contexts)
Missing class my.project.core.navigation.Screen$BarcodeScannerScreen (referenced from: kotlin.Unit my.project.new.ui.main.MainScreenKt$MainScreen$6$1$1.invoke$lambda$6$lambda$5$lambda$4(androidx.navigation.NavController) and 1 other context)
Missing class my.project.core.navigation.Screen$CatalogResultScreen (referenced from: kotlin.Unit my.project.new.ui.main.MainScreenKt$MainScreen$6$1$3.invoke$lambda$40$lambda$12$lambda$11$lambda$10$lambda$9(androidx.navigation.NavController, my.project.feature_catalog_api.domain.models.NewCategoryDto) and 2 other contexts)
Missing class my.project.core.navigation.Screen$CompleteOrderScreen (referenced from: void my.project.new.ui.navigation.nav_graph.tabs.CartNavGraphKt.addCartRoute(androidx.navigation.NavGraphBuilder, java.lang.String, androidx.navigation.NavController, androidx.compose.foundation.layout.PaddingValues, kotlin.jvm.functions.Function1))
Missing class my.project.core.navigation.Screen$CreateOrderScreen (referenced from: void my.project.new.ui.navigation.nav_graph.tabs.CartNavGraphKt.addCartRoute(androidx.navigation.NavGraphBuilder, java.lang.String, androidx.navigation.NavController, androidx.compose.foundation.layout.PaddingValues, kotlin.jvm.functions.Function1))
I suggest that R8 delete necessary for project files, even if they are not related to any library like Hilt, Coil etc.
sg...@google.com <sg...@google.com> #3
I think the issue here is that you have minifyEnabled true
in one or more of your library modules. This will cause AGP to run R8 separately on these modules before passing them to the app build. The flag android.disableMinifyLocalDependenciesForLibraries
turns off this behavior. You should remove minifyEnabled true
from library modules and only have it for the app module.
si...@gmail.com <si...@gmail.com> #4
I sincerely appreciate it, this has resolved my issue.
sg...@google.com <sg...@google.com> #5
Happy to be able to help.
Description
My mult-module project to the new version of Android Gradle Plugin (8.8.2), R8 (8.7.18), Kotlin (2.1.10) and Gralde (8.10.2). When I try to launch (build was success) my project on release build I get error with stacktrace:
I tried to add some new rules in my
proguard-rules.pro
and disableandroid.enableR8.fullMode
but it didn't help.Before upgrade versions everything worked fine. Anyway if I set
android.disableMinifyLocalDependenciesForLibraries
to false my application works as usually but as it marked deprecated it would be better to avoid usage of this flag.I'm also using last version of Hilt (2.55) with ksp(2.1.10-1.0.31).
Here is my build.gradle(:app)
And proguard rules:
Coud you please provide me with suggestions on how to deal with this issue?