Stranger B.
Stranger B.

Reputation: 9364

Execution failed for task Android issue

Suddenly I have an error when trying to execute my android app.

the Error looks like :

enter image description here

Here is the full log :

    Information:Gradle tasks [:app:generateDebugSources, :app:prepareDebugUnitTestDependencies, :app:mockableAndroidJar, :app:assembleDebug]
:app:preBuild UP-TO-DATE
:app:preDebugBuild UP-TO-DATE
:app:checkDebugManifest
:app:preReleaseBuild UP-TO-DATE
:app:prepareComAndroidSupportAppcompatV72310Library UP-TO-DATE
:app:prepareComAndroidSupportCardviewV72103Library UP-TO-DATE
:app:prepareComAndroidSupportDesign2310Library UP-TO-DATE
:app:prepareComAndroidSupportMultidex101Library UP-TO-DATE
:app:prepareComAndroidSupportRecyclerviewV72310Library UP-TO-DATE
:app:prepareComAndroidSupportSupportV42310Library UP-TO-DATE
:app:prepareComAndroidadvanceTopsnackbar008Library UP-TO-DATE
:app:prepareComFacebookAndroidFacebookAndroidSdk460Library UP-TO-DATE
:app:prepareComIsseiaokiSimplecropview108Library UP-TO-DATE
:app:prepareComMelnykovFloatingactionbutton130Library UP-TO-DATE
:app:prepareDeHdodenhofCircleimageview130Library UP-TO-DATE
:app:prepareDebugDependencies
:app:compileDebugAidl UP-TO-DATE
:app:compileDebugRenderscript UP-TO-DATE
:app:generateDebugBuildConfig UP-TO-DATE
:app:generateDebugAssets UP-TO-DATE
:app:mergeDebugAssets UP-TO-DATE
:app:generateDebugResValues UP-TO-DATE
:app:generateDebugResources UP-TO-DATE
:app:mergeDebugResources UP-TO-DATE
:app:processDebugManifest UP-TO-DATE
:app:processDebugResources UP-TO-DATE
:app:generateDebugSources UP-TO-DATE
:app:preDebugUnitTestBuild UP-TO-DATE
:app:prepareDebugUnitTestDependencies
:app:mockableAndroidJar UP-TO-DATE
:app:processDebugJavaRes UP-TO-DATE
:app:compileDebugJava UP-TO-DATE
:app:compileDebugNdk UP-TO-DATE
:app:compileDebugSources UP-TO-DATE
:app:collectDebugMultiDexComponents UP-TO-DATE
:app:packageAllDebugClassesForMultiDex FAILED
Error:Execution failed for task ':app:packageAllDebugClassesForMultiDex'.
> java.util.zip.ZipException: duplicate entry: bolts/AppLink$Target.class
Information:BUILD FAILED
Information:Total time: 3.345 secs
Information:1 error
Information:0 warnings
Information:See complete output in console

My gradle looks like :

dependencies {
    repositories { mavenCentral() }
    compile fileTree(dir: 'libs', include: ['*.jar'])

    compile 'com.android.support:appcompat-v7:23.1.0'
    compile 'com.parse.bolts:bolts-android:1.+'
    compile fileTree(dir: 'libs', include: 'Parse-*.jar')
    compile 'com.android.support:recyclerview-v7:+'
    compile 'com.android.support:cardview-v7:21.0.+'
    compile 'com.squareup.picasso:picasso:2.5.2'
    compile 'de.hdodenhof:circleimageview:1.3.0'
    compile 'com.android.support:design:23.1.0'
    compile 'com.facebook.android:facebook-android-sdk:4.6.0'
    compile 'com.isseiaoki:simplecropview:1.0.8'
    compile fileTree(dir: 'libs', include: 'ParseCrashReporting-*.jar')
    compile 'com.melnykov:floatingactionbutton:1.3.0'
    androidTestCompile 'com.jayway.android.robotium:robotium:5.5.2'
    compile 'com.androidadvance:topsnackbar:0.0.8'
}

I tried to update Android Studio, Clean the project, build the project, always the same error.

Upvotes: 1

Views: 5701

Answers (1)

Mohammed Aouf Zouag
Mohammed Aouf Zouag

Reputation: 17142

Delete this line :

compile fileTree(dir: 'libs', include: 'Parse-*.jar')

This error occurs when you try to include the same library more than once in your Gradle file. So you need to make sure that there are no duplicate includes, clean & rebuild your project and you're good to go.

Upvotes: 1

Related Questions