Posts

Showing posts with the label Android Multidex

Androidx MutliDex: The Number Of Method References In A .dex File Cannot Exceed 64K

Answer : Modify the module-level build.gradle file to enable multidex and add the multidex library as a dependency, as shown here: android { defaultConfig { ... minSdkVersion 16 targetSdkVersion 28 multiDexEnabled true } ... } dependencies { implementation 'com.android.support:multidex:1.0.3' } If you do not override the Application class, edit your manifest file to set android:name in the tag as follows: <?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.example.myapp"> <application android:name="android.support.multidex.MultiDexApplication" > ... </application> </manifest> If you do override the Application class, change it to extend MultiDexApplication (if possible) as follows: ... import androidx.multidex.M...

Android Studio Java.lang.NoClassDefFoundError: Android.support.v4.app.NavUtilsJB

Answer : I had this problem and just found the solution - answer is RTFM! Here are the instructions: https://developer.android.com/tools/building/multidex.html Multidexing is a new feature and so requires a support library to be compatible with pre-lollipop devices. You need to add the following to your gradle file dependencies: compile 'com.android.support:multidex:1.0.0' Also enable multidex output in your gradle file: android { compileSdkVersion 21 buildToolsVersion "21.1.0" defaultConfig { ... minSdkVersion 14 targetSdkVersion 21 ... // Enabling multidex support. multiDexEnabled true } } And then add the multidex support application to your manifest: <?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.example.android.multidex.myapplication"> <application ...