IT狗

Android studio 容易看到毛病和成绩

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中设置上面的代码,缘故原由是引用了多个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 --> 查找到一切引用该类的类,这些类即为引发辩论的类
去掉本项目中gradle中用于引用有辩论的包的代码大概将辩论的代码从jar包或aar包中移除,确保一个module中只引用了一份相反的第三方包

3.project sturcture和Project Structure 不管是按快捷键大概是从files中翻开都不显现

event log中报: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)

办理方法:先看一下零碎设置的SDK的地位和Android Studio所用的途径是不是一样,假如不一样从头设置零碎的SDK途径大概是从头修正Android Studio的SDK途径
经过SDK Manager删除掉google API23
假如办理不了,卸载android studio -->从头装置 ,另有成绩点击File --> Invalidate Cashes/Restart --> Invalidate and Restart,办理不了继承经过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

项目中有错,没法删除这个文件夹上面的文件。手动删除debug文件夹或某东西破坏就可以(增补与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

应当是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.

http://stackoverflow.com/questions/33404552/execution-failed-for-task-appcompiledebugjavawithjavac-in-android-studio

8.注: E:/as_workspaces/DJIgo/tongyan-djigo-lib/src/main/java/com/tongyan/lib/djigo/ui/view/ControlMoveView.java运用或掩盖了已过期的 API。

注: 有关具体信息, 请运用 -Xlint:deprecation 从头编译。 android studio-File->Project Structure->Android sdk location(途径应当不准确)

9.Error:Execution failed for task ':app:compileDebugJavaWithJavac'.

> java.io.FileNotFoundException: E:/as_workspaces/TYSubway/app/libs/pushservice-4.5.6.88.jar (零碎找不到指定的文件。)

须要把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

项目中有错

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中细心找是不是有相反的jar包

14.Error:Execution failed for task ':app:clean'.

> Unable to delete directory: E:/as_workspaces/DJIGO_FLY/app/build/outputs/apk

没法删除这个文件夹下的文件,到目次上面就明白了。

15.关于R文件没法引入,引发很长时间没法找到毛病的泉源。比方:假如毛病在A类内里产生,可是Message里提醒的是B类的R文件没法引入。

这样你就要用排除法,就像做选择题,要将B类的成绩先解释掉,A类内里的成绩才会露出出来。

16. 2016-07-04

关于该成绩,须要留意的是。偶然候固然有个红叉可是也能运转,大概as校验引发该成绩。别的假如代码中没有甚么成绩时,就须要检察下AndroidManifest.xml是不是有毛病,一样平常状况下是这个缘故原由引发。只需明白这个就可以。

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

依照上面的解释,不能够删除这个目次,你就手动删除下

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 像这样不能够删除文件,你就找这个这个文件夹删除掉,假如不能够删除就破坏掉。官网的毛病提醒仍是对比傻瓜式的,他让你干嘛,你就干嘛就行了。

19.2016-07-18

http://stackoverflow.com/questions/29440321/nosuchfielderror-no-static-field-listview1-of-type-i-in-class-lcom-disdemo-rid
20.2016-09-14
当Model中的代码没法出产R文件,可以做以下操纵,但条件是包中的xml、java代码无辩论(确保之前尽全力多clean,然后检察Message)。
21.2016-09-16
当产生以下成绩时
1.将下图中的设置改成你AS中能编译项目中设置行就可以
2.以下图中的处所也须要留意下(就是讲现在你as中能一般运转的项目中的设置更换成这句distributionUrl-更新于20160920)
22.2016-09-23
EditText: layout tag was TextView [WrongViewCast]
场景:代码运转、clean、编译都没成绩,在手机上运转也没成绩,可是运用署名今后就曝该毛病。怎样折腾都不可,可是条件是一切代码都是准确的View的范例变换完整准确。
办理:AActivity在app包上面,可是layou结构在别的一个Library(下称B包)中,在办理成绩的进程中猜测大概是这个成绩引发,末了将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"
<a href="fixGradleElements">Fix plugin version and sync project</a><br><a href="openFile:E:/as_workspaces/PedometerDemo/app/build.gradle">Open File</a>

将该处的设置改成现在能运用的项目的设置

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导入的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 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.

File-->Project-->Structrue-->SDK Location-->JDK location

Use embedded JDK 后面勾去掉,指定一个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

当你android:targetSdkVersion="22" 再将22改成23时会碰到种种成绩,比方编译不经过,文件没法写入(权限注册过)。把手机上的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"}

此文由 IT狗 编辑,本网站所发布展示的作品/文章版权归原作者所有,任何商业用途均须联系作者!

相关推荐

评论 暂无评论