Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

com.android.dex.DexException: Multiple dex files define Ljavax/annotation/CheckForNull; #7

Open
yumodev opened this issue Jan 27, 2016 · 4 comments

Comments

@yumodev
Copy link

yumodev commented Jan 27, 2016

Hello:
At compile time following error occurred. Hope to get your help

Information:Gradle tasks [:app:assembleBaiduDebug]
:app:preBuild UP-TO-DATE
:app:preBaiduDebugBuild UP-TO-DATE
:app:checkBaiduDebugManifest
:app:preBaiduReleaseBuild UP-TO-DATE
:app:preC360DebugBuild UP-TO-DATE
:app:preC360ReleaseBuild UP-TO-DATE
:app:preLeanoteDebugBuild UP-TO-DATE
:app:preLeanoteReleaseBuild UP-TO-DATE
:app:preUcDebugBuild UP-TO-DATE
:app:preUcReleaseBuild UP-TO-DATE
:app:preWandoujiaDebugBuild UP-TO-DATE
:app:preWandoujiaReleaseBuild UP-TO-DATE
:app:prepareComAndroidSupportAppcompatV72221Library UP-TO-DATE
:app:prepareComAndroidSupportCardviewV72221Library UP-TO-DATE
:app:prepareComAndroidSupportDesign2221Library UP-TO-DATE
:app:prepareComAndroidSupportRecyclerviewV72221Library UP-TO-DATE
:app:prepareComAndroidSupportSupportV132221Library UP-TO-DATE
:app:prepareComAndroidSupportSupportV42221Library UP-TO-DATE
:app:prepareComAutomatticRest102Library UP-TO-DATE
:app:prepareComCrashlyticsSdkAndroidAnswers112Library UP-TO-DATE
:app:prepareComCrashlyticsSdkAndroidBeta112Library UP-TO-DATE
:app:prepareComCrashlyticsSdkAndroidCrashlytics222Library UP-TO-DATE
:app:prepareComGithubChrisbanesPhotoviewLibrary123Library UP-TO-DATE
:app:prepareComHelpshiftAndroidAar380Library UP-TO-DATE
:app:prepareComSimperiumAndroidSimperium064Library UP-TO-DATE
:app:prepareIoFabricSdkAndroidFabric120Library UP-TO-DATE
:app:prepareJpWasabeefRicheditorAndroid110Library UP-TO-DATE
:app:prepareOrgThoughtcrimeSslPinningAndroidPinning100Library UP-TO-DATE
:app:prepareOrgWordpressDragSortListview061Library UP-TO-DATE
:app:prepareOrgWordpressEmailchecker03Library UP-TO-DATE
:app:prepareOrgWordpressGraphview340Library UP-TO-DATE
:app:prepareOrgWordpressMediapicker124Library UP-TO-DATE
:app:prepareOrgWordpressPasscodelock100Library UP-TO-DATE
:app:prepareOrgWordpressPersistentedittext101Library UP-TO-DATE
:app:prepareOrgWordpressSlidinguppanel100Library UP-TO-DATE
:app:prepareBaiduDebugDependencies
:app:compileBaiduDebugAidl UP-TO-DATE
:app:compileBaiduDebugRenderscript UP-TO-DATE
:app:generateBaiduDebugBuildConfig UP-TO-DATE
:app:generateBaiduDebugAssets UP-TO-DATE
:app:mergeBaiduDebugAssets UP-TO-DATE
:app:generateBaiduDebugResValues UP-TO-DATE
:app:generateBaiduDebugResources UP-TO-DATE
:app:mergeBaiduDebugResources UP-TO-DATE
:app:processBaiduDebugManifest UP-TO-DATE
:app:processBaiduDebugResources UP-TO-DATE
:app:generateBaiduDebugSources UP-TO-DATE
:app:processBaiduDebugJavaRes UP-TO-DATE
:app:compileBaiduDebugJavaWithJavac
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
:app:compileBaiduDebugNdk UP-TO-DATE
:app:compileBaiduDebugSources
:app:preDexBaiduDebug
warning: Ignoring InnerClasses attribute for an anonymous inner class
(org.ccil.cowan.tagsoup.Parser$1) that doesn't come with an
associated EnclosingMethod attribute. This class was probably produced by a
compiler that did not target the modern .class file format. The recommended
solution is to recompile the class from source, using an up-to-date compiler
and without specifying any "-target" type options. The consequence of ignoring
this warning is that reflective operations on this class will incorrectly
indicate that it is not an inner class.
:app:dexBaiduDebug
UNEXPECTED TOP-LEVEL EXCEPTION:
com.android.dex.DexException: Multiple dex files define Ljavax/annotation/CheckForNull;
at com.android.dx.merge.DexMerger.readSortableTypes(DexMerger.java:596)
at com.android.dx.merge.DexMerger.getSortedTypes(DexMerger.java:554)
at com.android.dx.merge.DexMerger.mergeClassDefs(DexMerger.java:535)
at com.android.dx.merge.DexMerger.mergeDexes(DexMerger.java:171)
at com.android.dx.merge.DexMerger.merge(DexMerger.java:189)
at com.android.dx.command.dexer.Main.mergeLibraryDexBuffers(Main.java:454)
at com.android.dx.command.dexer.Main.runMonoDex(Main.java:303)
at com.android.dx.command.dexer.Main.run(Main.java:246)
at com.android.dx.command.dexer.Main.main(Main.java:215)
at com.android.dx.command.Main.main(Main.java:106)
Error:Execution failed for task ':app:dexBaiduDebug'.

com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command '/Library/Java/JavaVirtualMachines/jdk1.8.0_11.jdk/Contents/Home/bin/java'' finished with non-zero exit value 2
Information:BUILD FAILED
Information:Total time: 6 mins 39.455 secs
Information:1 error
Information:0 warnings
Information:See complete output in console

@binnchx
Copy link
Member

binnchx commented Jan 27, 2016

Are you using android studio ?
Have you ever changed build.gradle?

@yumodev
Copy link
Author

yumodev commented Jan 27, 2016

I use the Android Studio 1.5 and never change build.gradle

@binnchx
Copy link
Member

binnchx commented Jan 27, 2016

my environment is as follow:
image

@yumodev
Copy link
Author

yumodev commented Jan 27, 2016

now I can compile success . Next is my newer build.gradle 
 buildscript {
    repositories {
        mavenCentral()
        maven { url 'https://maven.fabric.io/repo' }
    }

//    dependencies {
//        classpath 'com.android.tools.build:gradle:1.0.0'
//        classpath 'com.github.nrudenko:gradle-android-cq-plugin:0.1+'
//        classpath 'io.fabric.tools:gradle:1.+'
//    }
}

repositories {
    mavenCentral()
    jcenter()
    maven { url 'http://wordpress-mobile.github.io/WordPress-Android' }
    maven { url 'https://maven.fabric.io/repo' }
}

apply plugin: 'com.android.application'
//apply plugin: 'android-cq'
//apply plugin: 'io.fabric'

android {
    packagingOptions {
        exclude "META-INF/LICENSE.txt"
        exclude "META-INF/NOTICE.txt"
        exclude 'META-INF/NOTICE'
        exclude 'META-INF/LICENSE'
    }
    dexOptions {
        jumboMode = true
    }

    compileSdkVersion 22
    buildToolsVersion "22.0.1"

    defaultConfig {
        applicationId "com.leanote.android"
        versionName "1.0.0"
        versionCode 196
        minSdkVersion 14
        targetSdkVersion 22

        buildConfigField "String", "APP_PN_KEY", "\"com.leanote.android.playstore\""

        // Enabling multidex support.
        multiDexEnabled true
    }

//    productFlavors {
////        vanilla {}
////
////        zbetagroup {
////            buildConfigField "String", "APP_PN_KEY", "\"com.leanote.android.beta.build\""
////            applicationId "com.leanote.android.beta"
////        }
//        wandoujia {}
//        baidu {}
//        c360 {}
//        uc {}
//        leanote {}
//
//        productFlavors.all { flavor ->
//            flavor.manifestPlaceholders = [UMENG_CHANNEL_VALUE: name]
//        }
//
//
//    }

    buildTypes {
        release {
            //minifyEnabled true
            //proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard.cfg'
            buildConfigField "String", "APP_PN_KEY", "\"com.leanote.android.debug.build\""
            ext.enableCrashlytics = false
        }

        debug {
            buildConfigField "String", "APP_PN_KEY", "\"com.leanote.android.debug.build\""
            ext.enableCrashlytics = false
        }
    }


}

dependencies {
    //compile 'com.crashlytics.sdk.android:crashlytics:2.2.2'

    // Provided by maven central
    compile 'org.wordpress:mediapicker:1.2.4'
    compile 'org.apache.httpcomponents:httpclient-android:4.3.5.1'
    compile 'org.apache.httpcomponents:httpmime:4.3'
    compile 'com.google.code.gson:gson:2.2.2'
    compile 'org.ccil.cowan.tagsoup:tagsoup:1.2.1'
    compile 'com.android.support:cardview-v7:22.2.1'
    compile 'com.android.support:recyclerview-v7:22.2.1'
    compile 'com.android.support:design:22.2.1'
    compile 'com.github.chrisbanes.photoview:library:1.2.3'
    compile 'com.helpshift:android-aar:3.8.0'
    compile 'commons-lang:commons-lang:2.6'
    compile 'de.greenrobot:eventbus:2.4.0'
    compile 'com.automattic:rest:1.0.2'
    compile 'org.wordpress:graphview:3.4.0'
    compile 'org.wordpress:persistentedittext:1.0.1'
    compile 'com.loopj.android:android-async-http:1.4.9'
    compile 'com.belladati:httpclientandroidlib:4.3.0'
    compile 'com.nostra13.universalimageloader:universal-image-loader:1.9.5'
    compile 'org.mongodb:mongo-java-driver:2.12.4'
    compile 'jp.wasabeef:richeditor-android:+'
    //compile 'com.nostra13.universalimageloader:universal-image-loader:+'
//
//    androidTestCompile 'com.google.dexmaker:dexmaker-mockito:1.0'
//    androidTestCompile 'org.objenesis:objenesis:2.1'
//    androidTestCompile 'org.mockito:mockito-core:+'

    // Provided by the WordPress-Android Repository
    compile 'org.wordpress:gcm:1.0.0' // not found in maven central
    compile 'org.wordpress:drag-sort-listview:0.6.1' // not found in maven central
    compile 'org.wordpress:slidinguppanel:1.0.0' // not found in maven central
    compile 'org.wordpress:passcodelock:1.0.0'
    compile 'org.wordpress:emailchecker:0.3'

    // Simperium
    compile 'com.simperium.android:simperium:0.6.4'

    compile 'com.android.support:multidex:1.0.0'
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants