android studio新建项目后出现bug finished with non-zero exit value 1
来源:互联网 发布:软件教育 编辑:程序博客网 时间:2024/05/22 11:34
1、Error:Execution failed for task ':app:transformClassesWithDexForDebug'.
> com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command 'C:\Program Files\Java\jdk1.7.0_25\bin\java.exe'' finished with non-zero exit value 1
解决办法是
Reference:http://stackoverflow.com/questions/32889059/android-studio-1-4-and-vector-image/32889565#32889565
2.Error:Execution failed for task ':app:transformResourcesWithMergeJavaResForDebug'.
> com.android.build.api.transform.TransformException: com.android.builder.packaging.DuplicateFileException: Duplicate files copied in APK META-INF/maven/commons-io/commons-io/pom.properties
File1: E:\Users\Alarm\app\build\intermediates\exploded-aar\com.microsoft.projectoxford\vision\0.5.0\jars\libs\commons-io-2.4.jar
File2: E:\Users\Alarm\app\build\intermediates\exploded-aar\com.microsoft.projectoxford\emotion\1.0.0\jars\libs\commons-io-2.4.jar
解决办法:
packagingOptions { exclude 'META-INF/maven/commons-io/commons-io/pom.xml' exclude 'META-INF/maven/commons-io/commons-io/pom.properties' exclude 'META-INF/LICENSE.txt' exclude 'META-INF/NOTICE.txt' }Reference:http://blog.csdn.net/pipisorry/article/details/42965435
http://stackoverflow.com/questions/20827885/android-studio-0-4-duplicate-files-copied-in-apk-meta-inf-license-txt
http://blog.csdn.net/liuweiballack/article/details/47314101
3.
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.mouse.qq/com.mouse.qq.MainActivity}: java.lang.IllegalStateException: This app has been built with an incorrect configuration. Please configure your build for vectorDrawableCompat
解决办法:
reference:http://stackoverflow.com/questions/38869556/toolbar-illegalstateexception-configure-your-build-for-vectordrawablecompat
generatedDensities = []}// This is handled for you by the 2.0+ Gradle PluginaaptOptions { additionalParameters "--no-version-vectors"}
4.cannot resolve constructor I ntent
解决办法:
这是因为这是Intent语句是在内部类中(inner class)(监听器类是匿名内部类,一种特殊的内部类),这时如果想用 this 来引用 MyActivity 是实现不了的,这个错误的用法等同于:
Intent( OnClickListener Listener , Class class )
第一个参数是OnClickListener类,而不是Context类,所以是错误的。
要想修正报错,正确引用Myactivity ,就必须将:
Intent intent = new Intent(this , SecondActivity.class);
改为:
Intent intent = new Intent( MyActivity.this , SecondActivity.class);
Reference:http://www.dabu.info/android-cannot-resolve-constructor-intent.html
5.在Android studio中使用httpClient 需要在build.gradle引用
useLibrary 'org.apache.http.legacy'
- android studio新建项目后出现bug finished with non-zero exit value 1
- Android Studio finished with non-zero exit value 1
- Android Studio finished with non-zero exit value 1
- Android studio finished with non-zero exit value 1
- android studio编译较大项目时出现问题createDebugMainDexClassList....finished with non-zero exit value x
- Android Studio中运行项目出现 java.exe'' finished with non-zero exit value 2
- 解决android studio中出现的finished with non-zero exit value 1或者finished with non-zero exit value 2的问题
- android studio项目运行失败 finished with non-zero exit value 1 的解决办法
- Android Studio BUILD FAILED finished with non-zero exit value
- Android Studio 解决 finished with non zero exit value
- Android Studio中 finished with non-zero exit value 2
- Android studio finished with non-zero exit value 2
- Android:finished with non-zero exit value
- Android Studio 解决aapt "finished with non-zero exit value 1"问题,aaptnon-zero
- Android Studio 运行时出现 finished with non-zero exit value 2 错误分析
- Android studio 编译时出现java.exe finished with non-zero exit value 2
- Android Studio 运行时出现 finished with non-zero exit value 2
- Android Studio 运行时出现 finished with non-zero exit value 2 错误分析
- Java加载Class文件的原理机制
- 剑指offer经典编程(十一)
- 用户信息批量导出至EXCEL
- pat 1108. Finding Average (20)
- [NSBundle mainBundle] infoDictionary
- android studio新建项目后出现bug finished with non-zero exit value 1
- 面试中经常被问到的单例类
- dom4j解析xml
- __weak & __unsafe_unretained的用法以及区别
- hihoCoder 1142 三分求极值
- HTML之认识标签(二)
- 安卓绑定本地服务Service并与之通信
- 自定义饼状图
- Spring—AOP详解