Fixed
Status Update
Comments
uc...@google.com <uc...@google.com>
je...@google.com <je...@google.com>
ch...@google.com <ch...@google.com> #2
Adding "api 'com.android.support:multidex:1.0.2'" to the application module fixes the issue. But adding "implementation 'com.android.support:multidex:1.0.2'" doesn't.
ho...@gmail.com <ho...@gmail.com> #3
Can you please share your build.gradle files (for application and android library), as I am unable to reproduce?
From the screenshot, classes8.dex contains only references to the MultiDexApplication, it does not contain definitions of the class. If you execute `dexdump <path_to_apk>` are you able to see the definition of MultiDexApplication?
From the screenshot, classes8.dex contains only references to the MultiDexApplication, it does not contain definitions of the class. If you execute `dexdump <path_to_apk>` are you able to see the definition of MultiDexApplication?
ch...@google.com <ch...@google.com> #4
See attachments for more info.
ch...@google.com <ch...@google.com> #5
The difference when building from Studio is that we take into consideration the API of the device you are deploying to, so we might change legacy multidex build to a native multidex one. It looks like the device you are deploying to has API 25, so that is why APK differs when building from the command line and when building from the IDE. In legacy multidex we have requirements due to DalvikVM which classes are in the main dex, and that's why MultiDexApplication is in the classes.dex. However, for native multidex, ART is able to load classes from any classes<N>.dex file. So it is strange that the runtime is unable to find MultiDexApplication, when it's clearly in classes13.dex.
What is the device that you are trying to deploy the app to? From the screenshots it looks like it's a Chromebook?
What is the device that you are trying to deploy the app to? From the screenshots it looks like it's a Chromebook?
Description
Gradle: 4.1
AGP: 3.0.0-beta5
Build tools: 26.0.1
Problem:
The sample is using an annotation processor. It generates two helper classes MainActivity$$StateSaver and TestKotlinClass$$StateSaver. The app is using reflection to find those classes and to save the state.
After a clean build both classes are generated and bundled in the apk and everything working as expected. During an incremental build for some reason MainActivity$$StateSaver is NOT bundled in the app, whereas TestKotlinClass$$StateSaver is inside of the APK. You can easily see this by inspecting the apk.
Both classes are generated and can be found in app/build/generated/source/kapt/debug/com/elyeproj/evernotestateissue. There shouldn't be a reason why MainActivity$$StateSaver is not part of the APK.
I was able to reproduce the issue in the terminal and Android Studio.