2017-06-29 4 views
1

Ich bekomme immer denselben Fehler, wenn ich versuche, die apk zu bauen. Ich habe versucht, PhoneGap Build auch ohne Erfolg zu verwenden. Ich habe überprüft und die API-Version, die ich verwende, ist in Ordnung, das Java SDK ist das Neueste. Ich bin nicht sicher, was das Problem sein könnte, vielleicht eines der Plugins, die ich verwende? Ich habe auch versucht, die Plattform löschen und neu hinzufügen und Cordova sauber ausgeführt haben.Cordova Android Buildfehler: transformClassesWithDexForDebug FAILED

$ cordova build android --debug 
ANDROID_HOME=/Users/awhiteman/Library/Android/sdk 
JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_131.jdk/Contents/Home 
:wrapper 

BUILD SUCCESSFUL 

Total time: 0.723 secs 
Subproject Path: CordovaLib 
The Task.leftShift(Closure) method has been deprecated and is scheduled to be removed in Gradle 5.0. Please use Task.doLast(Action) instead. 
    at build_a80icgrgnmo2xiao0mubf7grh.run(/Users/awhiteman/Desktop/Dev-Systems-App/platforms/android/build.gradle:137) 
The JavaCompile.setDependencyCacheDir() method has been deprecated and is scheduled to be removed in Gradle 4.0. 
Incremental java compilation is an incubating feature. 
The TaskInputs.source(Object) method has been deprecated and is scheduled to be removed in Gradle 4.0. Please use TaskInputs.file(Object).skipWhenEmpty() instead. 
:preBuild UP-TO-DATE 
:preDebugBuild UP-TO-DATE 
:checkDebugManifest 
:preReleaseBuild UP-TO-DATE 
:CordovaLib:preBuild UP-TO-DATE 
:CordovaLib:preDebugBuild UP-TO-DATE 
:CordovaLib:checkDebugManifest 
:CordovaLib:prepareDebugDependencies 
:CordovaLib:compileDebugAidl 
:CordovaLib:compileDebugNdk UP-TO-DATE 
:CordovaLib:compileLint 
:CordovaLib:copyDebugLint UP-TO-DATE 
:CordovaLib:mergeDebugShaders 
:CordovaLib:compileDebugShaders 
:CordovaLib:generateDebugAssets 
:CordovaLib:mergeDebugAssets 
:CordovaLib:mergeDebugProguardFiles 
:CordovaLib:packageDebugRenderscript UP-TO-DATE 
:CordovaLib:compileDebugRenderscript 
:CordovaLib:generateDebugResValues 
:CordovaLib:generateDebugResources 
:CordovaLib:packageDebugResources 
:CordovaLib:processDebugManifest 
:CordovaLib:generateDebugBuildConfig 
:CordovaLib:processDebugResources 
:CordovaLib:generateDebugSources 
:CordovaLib:incrementalDebugJavaCompilationSafeguard 
:CordovaLib:compileDebugJavaWithJavac 
:CordovaLib:compileDebugJavaWithJavac - is not incremental (e.g. outputs have changed, no previous execution, etc.). 
Note: Some input files use or override a deprecated API. 
Note: Recompile with -Xlint:deprecation for details. 
:CordovaLib:processDebugJavaRes UP-TO-DATE 
:CordovaLib:transformResourcesWithMergeJavaResForDebug 
:CordovaLib:transformClassesAndResourcesWithSyncLibJarsForDebug 
:CordovaLib:mergeDebugJniLibFolders 
:CordovaLib:transformNative_libsWithMergeJniLibsForDebug 
:CordovaLib:transformNative_libsWithSyncJniLibsForDebug 
:CordovaLib:bundleDebug 
:CordovaLib:preReleaseBuild UP-TO-DATE 
:CordovaLib:checkReleaseManifest 
:CordovaLib:prepareReleaseDependencies 
:CordovaLib:compileReleaseAidl 
:CordovaLib:compileReleaseNdk UP-TO-DATE 
:CordovaLib:copyReleaseLint UP-TO-DATE 
:CordovaLib:mergeReleaseShaders 
:CordovaLib:compileReleaseShaders 
:CordovaLib:generateReleaseAssets 
:CordovaLib:mergeReleaseAssets 
:CordovaLib:mergeReleaseProguardFiles 
:CordovaLib:packageReleaseRenderscript UP-TO-DATE 
:CordovaLib:compileReleaseRenderscript 
:CordovaLib:generateReleaseResValues 
:CordovaLib:generateReleaseResources 
:CordovaLib:packageReleaseResources 
:CordovaLib:processReleaseManifest 
:CordovaLib:generateReleaseBuildConfig 
:CordovaLib:processReleaseResources 
:CordovaLib:generateReleaseSources 
:CordovaLib:incrementalReleaseJavaCompilationSafeguard 
:CordovaLib:compileReleaseJavaWithJavac 
:CordovaLib:compileReleaseJavaWithJavac - is not incremental (e.g. outputs have changed, no previous execution, etc.). 
Note: Some input files use or override a deprecated API. 
Note: Recompile with -Xlint:deprecation for details. 
:CordovaLib:processReleaseJavaRes UP-TO-DATE 
:CordovaLib:transformResourcesWithMergeJavaResForRelease 
:CordovaLib:transformClassesAndResourcesWithSyncLibJarsForRelease 
:CordovaLib:mergeReleaseJniLibFolders 
:CordovaLib:transformNative_libsWithMergeJniLibsForRelease 
:CordovaLib:transformNative_libsWithSyncJniLibsForRelease 
:CordovaLib:bundleRelease 
:prepareComAndroidSupportSupportCompat2600Alpha1Library 
:prepareComAndroidSupportSupportCoreUi2600Alpha1Library 
:prepareComAndroidSupportSupportCoreUtils2600Alpha1Library 
:prepareComAndroidSupportSupportFragment2600Alpha1Library 
:prepareComAndroidSupportSupportMediaCompat2600Alpha1Library 
:prepareComAndroidSupportSupportV42600Alpha1Library 
:prepareOrgApacheCordovaCordovaLib623DebugLibrary 
:prepareDebugDependencies 
:compileDebugAidl 
:compileDebugRenderscript 
:generateDebugBuildConfig 
:generateDebugResValues 
:generateDebugResources 
:mergeDebugResources 
:processDebugManifest 
:processDebugResources 
:generateDebugSources 
:incrementalDebugJavaCompilationSafeguard 
:compileDebugJavaWithJavac 
:compileDebugJavaWithJavac - is not incremental (e.g. outputs have changed, no previous execution, etc.). 
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. 
:compileDebugNdk UP-TO-DATE 
:compileDebugSources 
:mergeDebugShaders 
:compileDebugShaders 
:generateDebugAssets 
:mergeDebugAssets 
:transformClassesWithDexForDebug FAILED 

FAILURE: Build failed with an exception. 

* What went wrong: 
Execution failed for task ':transformClassesWithDexForDebug'. 
> com.android.build.api.transform.TransformException: com.android.ide.common.process.ProcessException: java.util.concurrent.ExecutionException: com.android.dex.DexException: Multiple dex files define Landroid/support/v4/accessibilityservice/AccessibilityServiceInfoCompat$AccessibilityServiceInfoVersionImpl; 

* Try: 
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. 

BUILD FAILED 

Total time: 3.076 secs 
Error: /Users/awhiteman/Desktop/Dev-Systems-App/platforms/android/gradlew: Command failed with exit code 1 Error output: 
Note: Some input files use or override a deprecated API. 
Note: Recompile with -Xlint:deprecation for details. 
Note: Some input files use or override a deprecated API. 
Note: Recompile with -Xlint:deprecation for details. 
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. 

FAILURE: Build failed with an exception. 

* What went wrong: 
Execution failed for task ':transformClassesWithDexForDebug'. 
> com.android.build.api.transform.TransformException: com.android.ide.common.process.ProcessException: java.util.concurrent.ExecutionException: com.android.dex.DexException: Multiple dex files define Landroid/support/v4/accessibilityservice/AccessibilityServiceInfoCompat$AccessibilityServiceInfoVersionImpl; 

* Try: 
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. 

Antwort

2

Multiple dex files define Landroid/support/v4/accessibilityservice/AccessibilityServiceInfoCompat$AccessibilityServiceInfoVersionImpl

Diese mehrere Versionen der Android-Support-Bibliothek zeigt verursacht eine Kollision. Wahrscheinlich haben Sie zwei oder mehr Plugins, die über ihre Gradle-Konfiguration verschiedene Versionen anfordern. Die einfachste Lösung ist die cordova-android-support-gradle-release Plugin zu Ihrem Cordova Projekt hinzuzufügen, die Gradle zwingen werden, die gleiche Version in allen Fällen zu verwenden:

cordova plugin add cordova-android-support-gradle-release 
+0

Dank! Ich habe das Plugin hinzugefügt und auch die Zeile multiDexEnabled true in der Datei bundle.gradle hinzugefügt und dieser Fehler wird nicht mehr angezeigt. –

Verwandte Themen