1.dexDebug ExecException finished with non-zero exit value 2 全bug日志如下:
(Error:Execution failed for task ':app:dexDebug'.?
> com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command 'D:\JDK8\jdk1.8.0_11\bin\java.exe'' finished with non-zero exit value 2)
需要在gradle中配置下面的代碼,原因是引用了多個(gè)libraries文件
defaultConfig {
multiDexEnabled true
}
2.Execution failed for task ':app:transformClassesWithJarMergingForDebug'.
> com.android.build.api.transform.TransformException: java.util.zip.ZipException: duplicate entry: android/support/v4/app/BackStackState$1.class
Error:Execution failed for task ':app:transformClassesWithJarMergingForDebug'.
> com.android.build.api.transform.TransformException: java.util.zip.ZipException: duplicate entry: android/support/annotation/ArrayRes.class
Error:Execution failed for task ':app:transformClassesWithJarMergingForDebug'.
> com.android.build.api.transform.TransformException: java.util.zip.ZipException: duplicate entry: com/android/volley/ServerError.class
原因:在所添加的jar包或aar包中也引用了support-V4,與工程中引用的相沖突
Ctrl+N --> 在搜索框中輸入BackStackState --> 查找到所有引用該類的類凯正,這些類即為引起沖突的類
去掉本工程中g(shù)radle中用于引用有沖突的包的代碼或者將沖突的代碼從jar包或aar包中移除,確保一個(gè)module中只引用了一份相同的第三方包
3.project sturcture和Project Structure 無論是按快捷鍵或者是從files中打開都不顯示
event log中報(bào):IllegalArgumentException:Multiple entries with same key: Google Inc.:Google APIs:23=Google APIs (Google Inc.) (API 23) and Google Inc.:Google APIs:23=Google APIs (Google Inc.) (API 23)
解決辦法:先看一下系統(tǒng)配置的SDK的位置和Android Studio所用的路徑是否一致轻姿,如果不一致重新配置系統(tǒng)的SDK路徑或者是重新修改Android Studio的SDK路徑
通過SDK Manager刪除掉google API23
如果解決不了,卸載android studio -->重新安裝 ,還有問題點(diǎn)擊File --> Invalidate Cashes/Restart --> Invalidate and Restart,解決不了繼續(xù)通過SDK Manager刪除掉google API23
4.
Error:Execution failed for task ':app:clean'.
> Unable to delete directory: E:\as_workspaces\DJIgo\app\build\intermediates\res\merged\debug
項(xiàng)目中有錯(cuò)器躏,無法刪除這個(gè)文件夾下面的文件军俊。手動(dòng)刪除debug文件夾或某工具粉碎即可(補(bǔ)充與20160916)。
5.
Error:Execution failed for task ':tongyan_bugs_framework_master:processDebugAndroidTestManifest'.
> java.lang.RuntimeException: Manifest merger failed : uses-sdk:minSdkVersion 18 cannot be smaller than version 19 declared in library [DJIgo:tysubwayinspection3.0-framework:unspecified] E:\as_workspaces\DJIgo\tongyan_bugs_framework_master\build\intermediates\exploded-aar\DJIgo\ty3.0-framework\unspecified\AndroidManifest.xml
Suggestion: use tools:overrideLibrary="com.ton.framework" to force usage
應(yīng)該是Library的sdk的版本與app的sdk的版本有沖突
?6.
Error:Execution failed for task ':app:processDebugManifest'.
> Manifest merger failed : uses-sdk:minSdkVersion 17 cannot be smaller than version 19 declared in library [DJIgo:tongyan-djigo-lib:unspecified] E:\as_workspaces\DJIgo\app\build\intermediates\exploded-aar\DJIgo\tongyan-djigo-lib\unspecified\AndroidManifest.xml
Suggestion: use tools:overrideLibrary="com.tongyan.lib.djigo" to force usage
7.
Error:Execution failed for task ':tongyan-djigo-lib:compileReleaseJavaWithJavac'.
> Compilation failed; see the compiler error output for details.
8.
注: E:\as_workspaces\DJIgo\tongyan-djigo-lib\src\main\java\com\tongyan\lib\djigo\ui\view\ControlMoveView.java使用或覆蓋了已過時(shí)的 API缆娃。
注: 有關(guān)詳細(xì)信息, 請使用 -Xlint:deprecation 重新編譯。 android studio-File->Project Structure->Android sdk location(路徑應(yīng)該不正確)
9.
Error:Execution failed for task ':app:compileDebugJavaWithJavac'.
> java.io.FileNotFoundException: E:\as_workspaces\TYSubway\app\libs\pushservice-4.5.6.88.jar (系統(tǒng)找不到指定的文件瑰排。)
需要把dependencies中的lib包下面的jar包全部取消下贯要,再添加。
10.
Error:Execution failed for task ':tysubwayinspection3.0-framework:packageReleaseResources'.
> java.io.IOException: Could not delete folder E:\as_workspaces\DJIgo\tysubwayinspection3.0-framework\build\intermediates\bundles\release\res
11.由于使用sdk5.0造成的以下問題椭住,需要用sdk6.0
E:\as_workspaces\DJIgo\app\build\intermediates\res\merged\debug\values-v23\values-v23.xml
Error:(3) Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Widget.Button.Inverse'.
Error:(18) Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Material.Button.Colored'.
Error:Execution failed for task ':app:processDebugResources'.
> com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command 'D:\Android\adt-bundle-windows-x86_64-20140702\android_sdk\build-tools\23.0.0\aapt.exe'' finished with non-zero exit value 1
12.
Error:Execution failed for task ':app:clean'.
> Unable to delete file: E:\as_workspaces\DjiGo-Demo\app\build\intermediates\exploded-aar\com.android.support\support-v4\23.3.0\jars\classes.jar
項(xiàng)目中有錯(cuò)
13.
Error:Execution failed for task ':app:transformClassesWithJarMergingForDebug'.
> com.android.build.api.transform.TransformException: java.util.zip.ZipException: duplicate entry: android/support/annotation/IntegerRes.class
包沖突了崇渗,在app及子library中仔細(xì)找是否有相同的jar包
14.
Error:Execution failed for task ':app:clean'.
> Unable to delete directory: E:\as_workspaces\DJIGO_FLY\app\build\outputs\apk
無法刪除這個(gè)文件夾下的文件,到目錄下面就知道了。
15.
關(guān)于R文件無法引入宅广,導(dǎo)致很長時(shí)間無法找到錯(cuò)誤的根源葫掉。比如:如果錯(cuò)誤在A類里面發(fā)生,但是Message里提示的是B類的R文件無法引入跟狱。
這樣你就要用排除法俭厚,就像做選擇題,要將B類的問題先注釋掉驶臊,A類里面的問題才會(huì)暴露出來套腹。
16. 2016-07-04
關(guān)于該問題,需要注意的是资铡。有時(shí)候雖然有個(gè)紅叉但是也能運(yùn)行,可能as校驗(yàn)導(dǎo)致該問題幢码。另外如果代碼中沒有什么問題時(shí)笤休,就需要查看下AndroidManifest.xml是否有錯(cuò)誤,一般情況下是這個(gè)原因?qū)е轮⒏薄V灰肋@個(gè)即可店雅。
17.2016-07-04
Error:Execution failed for task ':Tongyan_StructureCheck_Library:clean'.
> Unable to delete directory: E:\as_workspaces\TYSubwayInspectionNJ_Reconsitution\StructureCheck_Library\build\intermediates\exploded-aar
按照上面的說明,不能刪除這個(gè)目錄贞铣,你就手動(dòng)刪除下
18.2016-07-15
Error:Execution failed for task ':app:clean'.
> Unable to delete directory: E:\as_workspaces\TYSubwayInspectionNJ_Reconsitution\app\build\intermediates\classes\debug\com\tongyan\nanjing\subway
Unable to delete directory 像這樣不能刪除文件闹啦,你就找這個(gè)這個(gè)文件夾刪除掉,如果不能刪除就粉碎掉辕坝。官網(wǎng)的錯(cuò)誤提示還是比較傻瓜式的窍奋,他讓你干嘛,你就干嘛就行了酱畅。
19.2016-07-18
20.2016-09-14
當(dāng)Model中的代碼無法生產(chǎn)R文件琳袄,可以做如下操作,但前提是包中的xml纺酸、java代碼無沖突(保證之前盡量多clean窖逗,然后查看Message)。
21.2016-09-16
當(dāng)發(fā)生如下問題時(shí)
1.將下圖中的配置改成你AS中能編譯項(xiàng)目中配置行即可
2.如下圖中的地方也需要注意下(就是講目前你as中能正常運(yùn)行的項(xiàng)目中的配置替換成這句distributionUrl-更新于20160920)
?22.2016-09-23
EditText: layout tag was TextView [WrongViewCast]
場景:代碼運(yùn)行餐蔬、clean碎紊、編譯都沒問題,在手機(jī)上運(yùn)行也沒問題樊诺,但是使用簽名以后就曝該錯(cuò)誤仗考。怎么折騰都不行,但是前提是所有代碼都是正確的View的類型轉(zhuǎn)換完全正確啄骇。
解決:AActivity在app包下面痴鳄,但是layou布局在另外一個(gè)Library(下稱B包)中,在解決問題的過程中猜想可能是這個(gè)問題導(dǎo)致缸夹,最后將B包中本屬于app包下面的布局文件移至app包下面就解決了該問題痪寻。
23.2016-10-24
Error:(1, 0) Plugin is too old, please update to a more recent version, or set ANDROID_DAILY_OVERRIDE environment variable to "ad3f801955f53e94516853b8f93ac2b9ee8cc4"
Fix plugin version and sync project
Open File
將該處的配置改成目前能使用的項(xiàng)目的配置
?24.2016-10-24
Error:Could not open no_initscript class cache for initialization script 'C:\Users\Rubert\AppData\Local\Temp\asLocalRepo194.gradle' (C:\Users\Rubert\.gradle\caches\2.4\scripts\asLocalRepo194_dzs652nv4687n61mc501sfben\InitScript\no_initscript).
> Failed to create directory 'C:\Users\Rubert\.gradle\caches\2.4\scripts\asLocalRepo194_dzs652nv4687n61mc501sfben\InitScript\no_initscript\classes'
?25.2016-11-01
Error:Execution failed for task ':app:transformClassesWithDexForDebug'.?
> com.android.build.api.transform.TransformException: java.lang.RuntimeException: java.lang.RuntimeException: com.android.ide.common.process.ProcessException: java.util.concurrent.ExecutionException: java.lang.UnsupportedOperationException
該問題是由于libs導(dǎo)入的v4包版本有問題螺句,后來改成下面就可以了
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
compile files('libs/Volley.jar')
compile files('libs/gson-1.7.1.jar')
compile 'com.android.support:support-v4:22.0.0'
}
26.2016.12.26
> Cannot find SystemJava?Compiler. Ensure that you have installed a JDK (not just a JRE) and configured your JAVA_HOME system variable to point to the according directory.
File-->Project-->Structrue-->SDK Location-->JDK location??
Use embedded JDK 前面勾去掉,指定一個(gè)JDK地址橡类。
27.2017.1.10
Error:com.android.builder.internal.aapt.AaptException: Failed to crunch file E:\as_workspaces\TYSubwayInspectionNJ_Reconsitution3\Tongyan_StructureCheck_Library\build\intermediates\exploded-aar\TYSubwayInspectionNJ_Reconsitution3\Tongyan_Framework_Library\unspecified\res\drawable-hdpi-v4\np_numberpicker_up_disabled_focused_holo_dark.png into E:\as_workspaces\TYSubwayInspectionNJ_Reconsitution3\Tongyan_StructureCheck_Library\build\intermediates\res\merged\androidTest\debug\drawable-hdpi-v4\np_numberpicker_up_disabled_focused_holo_dark.png
?修改名稱路徑蛇尚,避免路徑過長
28.2017.2.16
?當(dāng)你android:targetSdkVersion="22" 再將22改成23時(shí)會(huì)遇到各種問題,例如編譯不通過顾画,文件無法寫入(權(quán)限注冊過)取劫。把手機(jī)上的app刪除,再安裝即可研侣。
29.2017.2.23
Error:Error converting bytecode to dex:
Cause: com.android.dex.DexException: Multiple dex files define Landroid/support/v4/accessibilityservice/AccessibilityServiceInfoCompat$AccessibilityServiceInfoVersionImpl;
30.2017.2.24
Error:A problem occurred configuring project ':app'.
> Unable to find optional library: org.apache.http.legacy
android {
? ? compileSdkVersion 23? ? buildToolsVersion "23.0.3"? ? defaultConfig {
? ? ? ? applicationId 'com.xxx.xxxe'? ? ? ? minSdkVersion 14? ? ? ? targetSdkVersion 22? ? ? ? versionCode 1? ? ? ? versionName "1.0"? ? ? ? multiDexEnabled true? ? }
? ? buildTypes {
? ? ? ? release {
? ? ? ? ? ? minifyEnabled false? ? ? ? ? ? proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'}? ? }? ? productFlavors {? ? }useLibrary 'org.apache.http.legacy'}
?31.2017-03-08
Error:Execution failed for task ':app:compileReleaseJava'.
> Cannot find System Java Compiler. Ensure that you have installed a JDK (not just a JRE) and configured your JAVA_HOME system variable to point to the according directory.
將此處的勾選去掉谱邪,再改成你的jdk根目錄
?32.
Error:Error converting bytecode to dex:
Cause: com.android.dex.DexException: Multiple dex files define Lorg/apache/commons/net/DatagramSocketClient;
?clean
33.2017-04-28
Error:Execution failed for task ':app:transformClassesWithDexForDebug'.
> com.android.build.api.transform.TransformException: com.android.ide.common.process.ProcessException: java.util.concurrent.ExecutionException: java.lang.UnsupportedOperationException
同第25.
34.2017-04-28
android API23 無法使用HttpClient無法使用,在build.gradle文件中加入下面代碼即可
android {? ? useLibrary"org.apache.http.legacy"
}
35.2017-07-06
Error:Failed to open zip file.
Gradle's dependency cache may be corrupt (this sometimes occurs after a network connection timeout.)
Re-download dependencies and sync project (requires network)
Re-download dependencies and sync project (requires network)
該問題主要是你Gradle版本不對庶诡,在當(dāng)前正常能運(yùn)行的項(xiàng)目中File->Project Structure->Project->gradle version (2.14.1)惦银,將該版本設(shè)置到你不能運(yùn)行的項(xiàng)目中的相同位置。然后末誓,就沒有然后了扯俱。
?36.2017-08-08
Error:Execution failed for task ':app:processDebugResources'.
> com.android.ide.common.process.ProcessException: Failed to execute aapt
?看看是不是少包了
37.2017-11-04
Error:Failed to complete Gradle execution.? Cause: Protocol family unavailable
使用Android Studio創(chuàng)建新項(xiàng)目后,一直出現(xiàn) “Failed to complete Gradle execution. Cause: A fatal exception has occurred. Program will exit”這個(gè)問題喇澡。解決方法是:
打開工程的gradle.properties文件迅栅,添加如下配置項(xiàng):
org.gradle.jvmargs=-Xmx512m -XX:MaxPermSize=512m
這個(gè)問題應(yīng)該就不會(huì)出現(xiàn)了。
38.2017-12-01
build\intermediates\res\merged\debug\values\values.xml
將下列三個(gè)版本改成相同的
compileSdkVersion
compileSdkVersion
targetSdkVersion
39.2018-01-03
E:\as_workspaces\HQDetectionSysForMob\app\build\intermediates\res\merged\debug\values\values.xml
Error:(203) Error retrieving parent for item: No resource found that matches the given name 'Theme.AppCompat.Light.Dialog'.
Error:(208, 21) No resource found that matches the given name: attr 'colorAccent'.
Error:(205, 21) No resource found that matches the given name: attr 'colorPrimary'.
Error:(207, 21) No resource found that matches the given name: attr 'colorPrimaryDark'.
Error:(204, 21) No resource found that matches the given name: attr 'windowActionBar'.
Error:(203) Error retrieving parent for item: No resource found that matches the given name 'Theme.AppCompat.Light.Dialog'.
Error:(208, 21) No resource found that matches the given name: attr 'colorAccent'.
Error:(205, 21) No resource found that matches the given name: attr 'colorPrimary'.
Error:(207, 21) No resource found that matches the given name: attr 'colorPrimaryDark'.
Error:(204, 21) No resource found that matches the given name: attr 'windowActionBar'.
Error:Execution failed for task ':app:processDebugResources'.
> com.android.ide.common.process.ProcessException: Failed to execute aapt
40.2018-01-22
Error:(25, 1) A problem occurred evaluating project ':app'.
> Could not find method implementation() for arguments [com.android.support.constraint:constraint-layout:1.0.2] on object of type org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler.
某個(gè)build文件中?
implementation 'com.android.support.constraint:constraint-layout:1.0.2'
這個(gè)刪除或者改成
compile
41.2018-01-08
Error:Execution failed for task ':app:compileDebugKotlin'.
> Compilation error. See log for more details
看下 EventLog
42.2018-04-04
Error:Execution failed for task ':app:transformDexWithDexForRelease'.
> com.android.build.api.transform.TransformException: com.android.ide.common.process.ProcessException: java.util.concurrent.ExecutionException: com.android.dex.DexIndexOverflowException: Cannot merge new index 66553 into a non-jumbo instruction!
?在 app 包下的 build.gradle文件中 加入android {?
dexOptions {
jumboMode true
}
} 記得別把a(bǔ)ndroid{}里面
43.2018-04-08
Error:Execution failed for task ':app:transformDexArchiveWithExternalLibsDexMergerForDebug'.
> com.android.builder.dexing.DexArchiveMergerException: Unable to merge dex
看下 EventLog和Gradle Console
44.2018.4.16
Error:Execution failed for task ':app:lintVitalRelease'.
> java.lang.NullPointerException (no error message)
在build.gradle加入下列注解
android{?
?lintOptions {
checkReleaseBuilds?false
abortOnError?false
}
}
?45.2018.4.27
Error:Execution failed for task ':app:packageRelease'.
> com.android.ide.common.signing.KeytoolException: Failed to read key subwaytroublecheckzz.keysto from store "E:\as_workspaces\TYSafetyInspection-ZZ-Doc\發(fā)布必備\SubwayTroubleCheckZZ.keystore": Cannot recover key
密碼錯(cuò)了晴玖,認(rèn)真重新輸入
?46.2018.5.2
Error:null value in entry: streamOutputFolder=null
解決辦法是读存,刪除項(xiàng)目根目錄的.gradle文件夾,然后Clean ,Rebulid窜醉。?
46.2018.5.8
Error:A problem occurred configuring project ':app'.
> android-apt plugin is incompatible with the Android Gradle plugin. Please use 'annotationProcessor' configuration instead.
47.2018.5.9
java.lang.RuntimeException: Unable to instantiate application org.odk.collect.android.application.Collect: java.lang.ClassNotFoundException: Didn't find class "org.odk.collect.android.application.Collect" on path: DexPathList[[zip file "/system/framework/com.google.android.maps.jar"],nativeLibraryDirectories=[/vendor/lib, /system/lib]]
https://github.com/opendatakit/collect/issues/387
Android4.4中的問題宪萄,填了兩次坑。解決辦法:自定義的Application需要繼承MultiDexApplication?(
compile 'com.android.support:multidex:1.0.0'
)
48.2018.7.24
Error:Execution failed for task ':app:transformClassesWithDexForRelease'.
> com.android.build.api.transform.TransformException: com.android.ide.common.process.ProcessException: java.util.concurrent.ExecutionException: java.lang.OutOfMemoryError: GC overhead limit exceeded
解決辦法:項(xiàng)目下有個(gè)gradle.properties文件榨惰,修改org.gradle.jvmargs=-Xmx1536m拜英,將1536的值改大點(diǎn)
?49. 2018.8.28
Error:Execution failed for task ':app:transformResourcesWithMergeJavaResForDebug'. > More than one file was found with OS independent path 'META-INF/DEPENDENCIES'
轉(zhuǎn)載? https://www.cnblogs.com/royi123/p/5378056.html