alenz316
05/14/2021, 5:37 PME/AndroidRuntime( 3715): Caused by: java.lang.NoClassDefFoundError: kotlin.collections.EmptyList
E/AndroidRuntime( 3715): at kotlin.collections.CollectionsKt__CollectionsKt.emptyList(SourceFile:71)
E/AndroidRuntime( 3715): at kotlin.collections.CollectionsKt.emptyList(SourceFile)
E/AndroidRuntime( 3715): ... 16 more
However, this crash does not happen on newer versions of Android (API 29) or if we have kotlinOptions.useOldBackend = true
, any idea what's the underlying cause in the new IR back-end that would cause it to crash on older versions of Android?ephemient
05/14/2021, 5:42 PMalenz316
05/14/2021, 5:49 PMalenz316
05/14/2021, 5:50 PMThis shouldn't happen for code that's accessed directly from your app code because the build tools recognize those code paths, but it can happen when the code paths are less visible such as when a library you use has complex dependencies. For example, if the code uses introspection or invocation of Java methods from native code, then those classes might not be recognized as required in the primary DEX file.- https://developer.android.com/studio/build/multidex#keep ☝️ We are not doing anything tricky, so the build tools should be able to figure it out. Is the new IR back-end doing something tricky that might be tripping it up?
ephemient
05/14/2021, 5:57 PMephemient
05/14/2021, 5:57 PMalenz316
05/14/2021, 5:58 PMephemient
05/14/2021, 5:59 PMalenz316
05/14/2021, 6:19 PMalenz316
05/14/2021, 6:20 PMalenz316
05/14/2021, 6:31 PMalenz316
05/14/2021, 6:43 PMkotlin.collections.EmptyList
in the main dex file classes.dex
.ephemient
05/14/2021, 8:16 PMephemient
05/14/2021, 8:18 PM