我看了這麼多的線程,仍然沒有找到工作的解決方案。構建APK - 錯誤 - 應用程序:transformClassesWithDexForDebug
當我想建立APK,我得到這個主要錯誤:
Error:Execution failed for task ':app:transformClassesWithDexForDebug'. com.android.build.api.transform.TransformException: com.android.ide.common.process.ProcessException: java.util.concurrent.ExecutionException: com.android.ide.common.process.ProcessException: Error while executing java process with main class com.android.dx.command.Main with arguments {--dex --num-threads=4 --multi-dex --main-dex-list C:\Users\ratik\Desktop\BUILDBOX\VOLUNTEER\STUDIO\app\build\intermediates\multi-dex\debug\maindexlist.txt --output C:\Users\ratik\Desktop\BUILDBOX\VOLUNTEER\STUDIO\app\build\intermediates\transforms\dex\debug\folders\1000\1f\main C:\Users\ratik\Desktop\BUILDBOX\VOLUNTEER\STUDIO\app\build\intermediates\transforms\jarMerging\debug\jars\1\1f\combined.jar}
有幾個錯誤,但隨後apear只是有時,他們中的一些:
Error: at com.android.dx.cf.direct.ClassPathOpener.processArchive(ClassPathOpener.java:284)
Error: at com.android.dx.command.dexer.Main.processFileBytes(Main.java:723)
Error: at com.android.dx.cf.direct.DirectClassFile.parseToInterfacesIfNecessary(DirectClassFile.java:388)
Error:java.lang.OutOfMemoryError: GC overhead limit exceeded
我試過的:
在build.gradle
apply plugin: 'com.android.application'
android {
compileSdkVersion 25
buildToolsVersion "25.0.2"
defaultConfig {
applicationId "com.biif.volunteer"
minSdkVersion 14
targetSdkVersion 25
multiDexEnabled true
ndk {
moduleName "player_shared"
}
}
buildTypes {
release {
minifyEnabled false
shrinkResources false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
}
}
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')
}
在清單
android:name="android.support.multidex.MultiDexApplication"
另外,我關掉即時運行(鋸在一個線程在這裏)。
沒有什麼幫助:(用於幫助球員:)任何想法,請感謝
執行後:compile'com.google.android.gms:play-services:10.2.1' 我收到錯誤:錯誤:任務':app:transformClassesWithJarMergingForDebug'的執行失敗。 > com.android.build.api.transform.TransformException:java.util.zip.ZipException:重複條目:android/support/v4/text/TextUtilsCompat.class – mousik