We have been using multidex in our application for a long time, but recently with the last update it fails in the android 19 API, for example an emulator with api 16 This is standard java.lang.NoClassDefFoundError.
If I define multidexKeepProguard for the missing class, for example. java.lang.NoClassDefFoundError. rx.plugins.RxJavaHooks exception
-keep class rx.plugins.**{*;}
then it just fails elsewhere for the same reason NoClassDefFound
Here are the settings for the runner, application, and manifest:
https://gist.github.com/originx/1890599b57b0ee3e14a85a4732301cd9
Logcat:
https://gist.github.com/originx/887f80d405334f1903b3024eb5cd1024
Setting up the development environment:
Android Studio 2.2.2 Build # AI-145.3360264, built on October 18, 2016 JRE: 1.8.0_112-release-b05 x86_64 JVM: 64-bit OpenJDK virtual machine from JetBrains sro
Compilation options
compile 'com.android.support:multidex:1.0.1'
assembly tool information:
classpath 'com.android.tools.build:gradle:2.2.2' compileSdkVersion 25 buildToolsVersion '25' defaultConfig { applicationId "app.packagename.com" minSdkVersion 16 targetSdkVersion 25 testInstrumentationRunner "de.payback.app.CustomAndroidJUnitRunner" multiDexEnabled true } dexOptions { jumboMode true preDexLibraries false javaMaxHeapSize "4g" maxProcessCount = 8 } debug { applicationIdSuffix '.debug' versionNameSuffix '-debug' signingConfig signingConfigs.debug minifyEnabled false shrinkResources debugShrinkResourcesEnabled proguardFiles getDefaultProguardFile('proguard-android.txt'), '../proguardRules/proguard-rules.pro', '../proguardRules/proguard-debug-rules.pro' // multiDexKeepProguard file('../proguardRules/multidex-proguard.pro') testProguardFiles getDefaultProguardFile('proguard-android.txt'), '../proguardRules/proguard-rules.pro', '../proguardRules/proguard-debug-test-rules.pro' testCoverageEnabled false } release { minifyEnabled true shrinkResources true testProguardFiles getDefaultProguardFile('proguard-android.txt'), '../proguardRules/proguard-rules.pro' proguardFiles getDefaultProguardFile('proguard-android.txt'), '../proguardRules/proguard-rules.pro' // multiDexKeepProguard file('../proguardRules/multidex-proguard.pro') }
I tried everything: from the MultiDexApplication extension to the custom MultiDex.install (context) to using MultiDexRunner
same results always
if you use the multidexkeepproguard file for classes that are not usually found, they are in the main dex file, but of course something else is missing, which indicates that multidex was not installed and initialized correctly
Google bug report:
https://code.google.com/p/android/issues/detail?id=228449
repo to reproduce the problem can be found here:
https://github.com/originx/multidex/tree/master
To start, disable instant start
To reproduce the problem with multiple addresses, run the following command
./gradlew clean connectedPayGermanyCompatDebugAndroidTest
runs on any device or API emulator 16. Tests on the GTI8190 4.1.2 failed. Instrumental launch failed due to java.lang.NoClassDefFoundError
Any suggestions on how to get around this until I get more information from the Google team?