0

I've got the answer, but the answer can not help me. I want a detailed answer. this first problems. Program show "app:transferformDexArchiveWithExternalLibsDexMergerForDebug"

org.gradle.api.tasks.TaskExecutionException: Execution;

    failed for task ':app:transformDexArchiveWithExternalLibsDexMergerForDebug'.
        at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:100)
        at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:70)
        at org.gradle.api.internal.tasks.execution.OutputDirectoryCreatingTaskExecuter.execute(OutputDirectoryCreatingTaskExecuter.java:51)
        at org.gradle.api.internal.tasks.execution.SkipUpToDateTaskExecuter.execute(SkipUpToDateTaskExecuter.java:62)
        at org.gradle.api.internal.tasks.execution.ResolveTaskOutputCachingStateExecuter.execute(ResolveTaskOutputCachingStateExecuter.java:54)
        at org.gradle.api.internal.tasks.execution.ValidatingTaskExecuter.execute(ValidatingTaskExecuter.java:60)
        at org.gradle.api.internal.tasks.execution.SkipEmptySourceFilesTaskExecuter.execute(SkipEmptySourceFilesTaskExecuter.java:97)
        at org.gradle.api.internal.tasks.execution.CleanupStaleOutputsExecuter.execute(CleanupStaleOutputsExecuter.java:87)
        at 

second problems.

at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    at org.gradle.internal.concurrent.ThreadFactoryImpl$ManagedThreadRunnable.run(ThreadFactoryImpl.java:55)
    at java.lang.Thread.run(Thread.java:745)

And,the last Problems.

Caused by: com.android.tools.r8.utils.AbortException
    at com.android.tools.r8.utils.Reporter.failIfPendingErrors(Reporter.java:77)
    at com.android.tools.r8.utils.Reporter.fatalError(Reporter.java:58)
    at com.android.tools.r8.utils.ExceptionUtils.withCompilationHandler(ExceptionUtils.java:67)
    ... 131 more

This my build.gradel.

apply plugin: 'com.android.application'

android {
    compileSdkVersion 27
    buildToolsVersion '27.0.3'
    defaultConfig {
        applicationId "com.nsc.apk.herb4health"
        minSdkVersion 21
        targetSdkVersion 27
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
        defaultConfig {
            multiDexEnabled true
        }


    }

    buildTypes {
        release {
            lintOptions {
                checkReleaseBuilds false
                abortOnError false
            }
        }
    }


    packagingOptions {
        exclude 'META-INF/LICENSE-FIREBASE.txt'
        exclude 'META-INF/DEPENDENCIES.txt'
        exclude 'META-INF/LICENSE.txt'
        exclude 'META-INF/NOTICE.txt'
        exclude 'META-INF/NOTICE'
        exclude 'META-INF/LICENSE'
        exclude 'META-INF/DEPENDENCIES'
        exclude 'META-INF/notice.txt'
        exclude 'META-INF/license.txt'
        exclude 'META-INF/dependencies.txt'
        exclude 'META-INF/LGPL2.1'
    }

}




dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])

    androidTestImplementation('com.android.support.test.espresso:espresso-core:2.2.2', {
        exclude group: 'com.android.support', module: 'support-annotations'
    })


    implementation supportDependencies.appCompat
    implementation supportDependencies.recycler
    implementation supportDependencies.cardView
    implementation supportDependencies.kitCore

    implementation 'com.android.support:appcompat-v7:27.1.0'
    implementation 'com.android.support:design:27.1.1'
    implementation 'com.android.support:support-v4:27.1.1'

    implementation 'com.android.support.constraint:constraint-layout:1.1.0'
    implementation 'com.android.support:cardview-v7:27.1.1'

    // RecyclerView
    implementation 'com.android.support:recyclerview-v7:27.1.0'

    // For Cover Flow
    implementation 'com.squareup.picasso:picasso:2.5.2'
    implementation 'com.github.moondroid.coverflow:library:1.0'
    implementation 'com.flaviofaria:kenburnsview:1.0.7'
    implementation 'com.github.florent37:diagonallayout:1.0.7'

    // Glide
    implementation 'com.github.bumptech.glide:glide:4.3.1'

    implementation 'com.android.support:multidex:1.0.3'
    implementation 'com.karumi:dexter:2.3.1'

    implementation 'com.github.kittinunf.fuel:fuel-android:1.3.1'
    implementation 'com.github.medyo:android-about-page:1.1.1'
    implementation 'com.mani:ThinDownloadManager:1.2.7'

    implementation 'com.github.thomper:sweet-alert-dialog:v1.4.0'
    implementation 'com.google.firebase:firebase-core:15.0.0'
    implementation 'com.google.firebase:firebase-database:15.0.0'
    implementation 'com.google.firebase:firebase-storage:15.0.0'
    implementation 'com.google.firebase:firebase-messaging:15.0.0'
    implementation 'com.google.firebase:firebase-auth:15.0.0'
    implementation 'com.firebase:firebase-client-android:2.5.2'
    implementation 'com.firebaseui:firebase-ui-auth:3.3.0'


    implementation 'com.r0adkll:slidableactivity:2.0.6'
    implementation 'com.github.jrvansuita:MaterialAbout:+'
    implementation 'com.github.jrvansuita:IconHandler:v2.0.0'


    implementation 'com.google.code.gson:gson:2.8.2'
    implementation 'com.intellij:annotations:12.0'
    implementation "com.google.android.gms:play-services-gcm:15.0.0"

    implementation 'com.jakewharton:butterknife:8.8.1'
    annotationProcessor 'com.jakewharton:butterknife-compiler:8.8.1'
    implementation 'com.r0adkll:deadskunk:1.0.4-SNAPSHOT'
    annotationProcessor 'org.immutables:value:2.4.4'

    //ADD Library for Stack card view
    implementation 'in.arjsna:swipecardlib:1.0.2'
    //DetailBodyhumen
    //Circle Image View
    implementation 'de.hdodenhof:circleimageview:2.1.0'

    implementation('com.google.api-client:google-api-client-android:1.20.0') {
        exclude module: 'guava-jdk5'
    }





    testImplementation 'junit:junit:4.12'
}
apply plugin: 'com.google.gms.google-services'

My Android Show Build Monitor.

Caused by: java.lang.RuntimeException: java.lang.RuntimeException:

com.android.builder.dexing.DexArchiveMergerException: Unable to merge dex

Caused by: java.lang.RuntimeException: com.android.builder.dexing.DexArchiveMergerException: Unable to merge dex

Caused by: com.android.builder.dexing.DexArchiveMergerException: Unable to merge dex;

Caused by: com.android.dex.DexException: Multiple dex files define Lorg/jetbrains/annotations/NotNull;

And This build.gradel (Project:Name)

// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
    ext.roomVersion = '1.0.0'
    repositories {
        jcenter()
        mavenCentral()
        maven {
            url 'https://maven.google.com/'
            name 'Google'
        }
        google()
    }


    dependencies {
        classpath(
                'junit:junit:4.12'
        )
        classpath(
                'org.junit.jupiter:junit-jupiter-api:5.1.0'
        )
        classpath(
                'org.junit.jupiter:junit-jupiter-engine:5.1.0',
                'org.junit.vintage:junit-vintage-engine:5.1.0'
        )
        classpath 'com.android.tools.build:gradle:3.0.0'
        classpath "me.tatarka:gradle-retrolambda:3.7.0"
        classpath ('com.google.firebase:firebase-plugins:1.1.0') {
            exclude group: 'com.google.guava', module: 'guava-jdk5'
        }


        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
        classpath 'com.jakewharton:butterknife-gradle-plugin:8.6.0'
        classpath 'com.github.dcendents:android-maven-gradle-plugin:1.5'
        classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.4'
        classpath 'com.google.gms:google-services:3.2.0'


        classpath 'org.junit.platform:junit-platform-gradle-plugin:1.1.0'


    }

}

allprojects {
    repositories {
        jcenter()
        maven { url "https://oss.sonatype.org/content/repositories/snapshots/" }
        maven { url 'https://jitpack.io' }
        maven { url 'https://maven.fabric.io/public' }
        google()
    }
}

task clean(type: Delete) {
    delete rootProject.buildDir
}
ext {
    //App
    libraryCode = 1
    libraryVersion = "1"

    //Support and Build tools version
    compileSdk = 26
    targetSdk = 26
    minSdk = 14
    buildTools = '27.0.1'
    supportLibrary = '25.4.0'
    ftKit = '0.5.1'

    //Support Libraries dependencies
    supportDependencies = [
            support       : "com.android.support:support-v4:${supportLibrary}",
            appCompat     : "com.android.support:appcompat-v7:${supportLibrary}",
            recycler      : "com.android.support:recyclerview-v7:${supportLibrary}",
            cardView      : "com.android.support:cardview-v7:${supportLibrary}",
            kitCore       : "com.52inc:52Kit-core:${ftKit}"
    ]

}

I used to follow these steps, but it was not okay. Android studio warning - InnerClass annotations are missing corresponding EnclosingMember annotations

Non Sensei
  • 67
  • 1
  • 6

2 Answers2

0

This happens due to outdated library you have imported in your project.what you can do is update all library to latest version...or make another project and find out which library is making producing a problem

  • Thank you very mush.I did follow you, but I build my project failed. – Non Sensei Apr 27 '18 at 06:25
  • Sorry for the delay.....Ok that was quite tricky....so the problem is with "implementation 'com.r0adkll:deadskunk:1.0.4-SNAPSHOT' " library you have imported...as per my results ... try to find updated or alternative version of it.....tell me if it works .... so i can explain how i did that – Vishal Verma Apr 27 '18 at 19:53
  • I can't find library new version more than this. If I remove this library than my app can't build. – Non Sensei Apr 28 '18 at 14:37
  • Can you give me hint what this library do or a documentation for it – Vishal Verma Apr 28 '18 at 21:04
  • I followed form https://github.com/r0adkll/Slidr Files java for my project https://github.com/bitotassuya/Herb4Health2/tree/master/app/src/main/java/com/example/asus/herbs4health – Non Sensei Apr 29 '18 at 02:56
  • So I have gone through the library....and its look like you want to implement slide-to-dismiss functionality to your Activity. But dependency you are using"com.r0adkll:deadskunk:1.0.4-SNAPSHOT" does not matchs with depandency given in library...(compile 'com.r0adkll:slidableactivity:2.0.6') – Vishal Verma Apr 29 '18 at 07:20
0

This error happens when you add an external library which may not be compatible with your compileSdkVersion .

Firstly update, cleaned and rebuilt the app, if not fixed still follow below link.

https://stackoverflow.com/a/48531191/6920195

Rohan Lodhi
  • 1,385
  • 9
  • 24