I want to use multidex in my application, At First I used depedencies :
'com.google.android:multidex:0.1'
, but after compile this error appeared :
Error:Execution failed for task ':packageAllDebugClassesForMultiDex'.
java.util.zip.ZipException: duplicate entry: android/support/multidex/BuildConfig.class
then I changed 'com.google.android:multidex:0.1'
to 'com.android.support:multidex:1.0.1'
, but after that import android.support.multidex.MultiDex;
in application class cannot be resolved, anybody can help ?
Add this into your build.gradile
android {
compileSdkVersion 21
buildToolsVersion "21.1.0"
defaultConfig {
...
minSdkVersion 14
targetSdkVersion 21
...
// Enabling multidex support.
multiDexEnabled true
}
...
}
dependencies {
compile 'com.android.support:multidex:1.0.0'
}
Also add this into 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
...
android:name="android.support.multidex.MultiDexApplication">
...
</application>
</manifest>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With