Live Literals causing a crash, even when they're t...
# compose-android
m
Live Literals causing a crash, even when they're turned off? My code is crashing on startup with
java.lang.NoSuchMethodError: No virtual method Int$class-BillingManager()I in class L.../LiveLiterals$BillingManagerKt; or its super classes (declaration of '....LiveLiterals$BillingManagerKt' appears in /data/app/~~E_lR4r6b7XyXTOKpNrELhg==/...-KBa2hT_RN0cmb1Z9Gqnwjg==/base.apk!classes3.dex)
but I've switched Live Literals to every possibility from on to off in the project settings and this is what I get. BillingManager is my own class, expected in commonMain and actual-ly in androidMain. Is this a bug of mine, or somewhere else?
s
It's likely not your bug, but it also indicates that live literals are not off :)
m
So how do I turn them off? Does the dialog in the settings window not work?
s
Seems like Android Studio always enabled live literals for some reason
m
B*m! That's not good. Thanks for the link, I'll have a look.
I tried to apply this with
Copy code
tasks.withType<org.jetbrains.kotlin.gradle.tasks.KotlinCompileCommon>().configureEach {
    kotlinOptions {
        freeCompilerArgs = freeCompilerArgs + listOf(
            "-P",
            "plugin:androidx.compose.compiler.plugins.kotlin:liveLiteralsEnabled=false",
        )
    }
}
in the build file for the shared module, cleaned and rebuilt the project and cleared caches and restarted AS... still got the LiveLiterals error :(
s
I guess the next step would be to move the broken code to a separate module where compose compiler cannot touch it :)
m
Just found that the code runs fine in a different flavour! There are no appreciable differences in my code, the one built with minify enabled works 🙀
s
Yeah, live literals are disabled in release