AS填坑
2017-05-03 09:55
113 查看
1,
2,
23版本的有两个,直接删除D:\LocalSDK\AndroidStudio\sdk\add-ons\文件夹下的一个就行,留一个。问题解决!
3,
可以查看发现在.idea/libraries中发现两个不同版本的nohttp的jar包。
所以,解决问题也就很简单,想办法去掉一个就行。我是这样干的,先重新选定一个版本进行编译。如何再clean掉,最后再运行。问题解决
4,
网上有说重启adb。执行命令adb kill-server; adb start-server。
我试过无效。最后是重启电脑才好了。
5,
Error:warning: Ignoring InnerClasses attribute for an anonymous inner class
在该项目里的proguard-rules.pro 中加入下面这句代码即可:
问题解决
之后问题又出现了,这个问题还会导致无法打包
解决办法是,在开发的项目build.gradle中添加
之后再打包,可以成功,问题解决
5,
Android Studio更新到2.0以后,在build variants窗口下没有 test artifact选项,无法选择是Android Instrumentation Tests还是Unit Tests
Google一下,解决方案是依次打开: File Menu -> Settings -> Build, Execution, Deployment -> Build Tools -> Gradle -> Experimental,
将Enable all test artifacts (Unit Test and Instrumentation Test) in Android projects取消勾选,之后我们熟悉的Test Artifact就出现了,如下图
Gradle project sync failed.Please fix project and try again.
2,
Observed package id 'add-ons;addon-google_apis-google-23' in inconsistent location 'D:\LocalSDK\AndroidStudio\sdk\add-ons\addon-google_apis-google-23-1' (Expected 'D:\LocalSDK\AndroidStudio\sdk\add-ons\addon-google_apis-google-23')
23版本的有两个,直接删除D:\LocalSDK\AndroidStudio\sdk\add-ons\文件夹下的一个就行,留一个。问题解决!
3,
Error:Error converting bytecode to dex: Cause: com.android.dex.DexException: Multiple dex files define Lcom/yanzhenjie/nohttp/BuildConfig; :app:transformClassesWithDexForDebug FAILED 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: org.gradle.process.internal.ExecException: Process 'command 'C:\Program Files\Java\jdk1.8.0_101\bin\java.exe'' finished with non-zero exit value 2
可以查看发现在.idea/libraries中发现两个不同版本的nohttp的jar包。
所以,解决问题也就很简单,想办法去掉一个就行。我是这样干的,先重新选定一个版本进行编译。如何再clean掉,最后再运行。问题解决
4,
com.android.ddmlib.AdbCommandRejectedException: device offline Error while Installing APK
网上有说重启adb。执行命令adb kill-server; adb start-server。
我试过无效。最后是重启电脑才好了。
5,
Error:warning: Ignoring InnerClasses attribute for an anonymous inner class
Error:warning: Ignoring InnerClasses attribute for an anonymous inner class Error:(org.apache.commons.logging.LogFactory$1) that doesn't come with an Error:associated EnclosingMethod attribute. This class was probably produced by a Error:compiler that did not target the modern .class file format. The recommended Error:solution is to recompile the class from source, using an up-to-date compiler Error:and without specifying any "-target" type options. The consequence of ignoring Error:this warning is that reflective operations on this class will incorrectly Error:indicate that it is *not* an inner class.
在该项目里的proguard-rules.pro 中加入下面这句代码即可:
-keepattributes EnclosingMethod
问题解决
之后问题又出现了,这个问题还会导致无法打包
解决办法是,在开发的项目build.gradle中添加
defaultConfig { multiDexEnabled true } dependencies { compile 'com.android.support:multidex:1.0.1' }
之后再打包,可以成功,问题解决
5,
Android Studio更新到2.0以后,在build variants窗口下没有 test artifact选项,无法选择是Android Instrumentation Tests还是Unit Tests
Google一下,解决方案是依次打开: File Menu -> Settings -> Build, Execution, Deployment -> Build Tools -> Gradle -> Experimental,
将Enable all test artifacts (Unit Test and Instrumentation Test) in Android projects取消勾选,之后我们熟悉的Test Artifact就出现了,如下图
相关文章推荐
- g++: Internal error: Segmentation fault (program as) Please submit a full bug report.
- Table ‘xxx’ is marked as crashed and should be repaired ...
- mysql 1449 : The user specified as a definer ('root'@'%') does not exist 解决方法
- 关于Aspose.NET使用的几点注意事项
- sql with as 用法
- C++ AMP: uses tile_static(lds) as function param: 2 methods ( array or Pointer)
- Error in as.POSIXlt.character(x, tz, ...) :
- NBA Players Would Like to Select Air Jordan 10 Shoes as Their Favorites
- flex与as基础
- PicklingError: Can't pickle <type 'generator'>: it's not found as __builtin_
- as 中的反射 describeType
- eric4中出现Could not start Qt-Designer. Ensure that it is available as designer.
- maven run as(debug as)没有运行的选项时
- android:showAsAction
- 信息: Marking servlet dispatcher as unavailable
- C# is 和 as的用法
- Using Apache Web Server with Jboss AS 7
- arm-linux-系列工具,ld,ar,as,objcopy
- Install VMware Workstation as a Service
- SQL 之witn as语法