java - Android Studio: Error:Execution failed for task ':app:transformClassesWithJarMergingForRelease'. > -


i need help, im new in android studio , im getting error:

error:execution failed task ':app:transformclasseswithjarmergingforrelease'. com.android.build.api.transform.transformexception: java.util.zip.zipexception: duplicate entry: android/support/v4/database/databaseutilscompat.class 

here build.gradle file , hope can help:

android {     compilesdkversion 25     buildtoolsversion "25.0.2"      defaultconfig {         applicationid "com.app_name.vallic.hr"         minsdkversion 14         targetsdkversion 25         multidexenabled true          ndk {             modulename "player_shared"         }     }      buildtypes {         release {             minifyenabled false             shrinkresources false             proguardfiles getdefaultproguardfile('proguard-android.txt'), 'proguard-rules.txt'         }       }      configurations {         all*.exclude group: 'com.android.support', module: 'support-v4'         all*.exclude group: 'com.android.support', module: 'support-annotations'     }      sourcesets.main {         jni.srcdirs = []// <-- disable automatic ndk-build call     } }  dependencies {     compile('com.google.android.gms:play-services:+') {         exclude module: 'support-v4'         compile files('libs/dagger-1.2.2.jar')         compile files('libs/javax.inject-1.jar')         compile files('libs/nineoldandroids-2.4.0.jar')         compile files('libs/support-v4-19.0.1.jar')         compile('com.android.support:multidex:1.0.1')     } } 

multidex having support v4 library classes, included v4 library separately.

so have exclude support v4 module multidex library.

change mulitdex library initialization this.

    compile ('com.android.support:multidex:1.0.1'){             exclude module: 'support-v4'         } 

you dependencies initialization should this.

dependencies {     compile('com.google.android.gms:play-services:+') {         exclude module: 'support-v4'     }     compile files('libs/dagger-1.2.2.jar')     compile files('libs/javax.inject-1.jar')     compile files('libs/nineoldandroids-2.4.0.jar')     compile files('libs/support-v4-19.0.1.jar')     compile('com.android.support:multidex:1.0.1'){     exclude module: 'support-v4'     } } 

hope helps:)


Comments

Popular posts from this blog

ubuntu - PHP script to find files of certain extensions in a directory, returns populated array when run in browser, but empty array when run from terminal -

php - How can i create a user dashboard -

javascript - How to detect toggling of the fullscreen-toolbar in jQuery Mobile? -