异常错误信息及解决方法合集(持续更新)

本文旨在记录开发过程中遇到的错误异常信息,并记录解决的办法以及自己对出现此种错误异常的原因的一些推测 若有纰漏还请各路大神不吝指正 

 

1.java.lang.IllegalArgumentException: No config chosen

原因:SDK找不到支持OPENGL的硬件

用户钩选了Use Host Gup 选项,此选项是说模拟器使用用户物理机上的GPU。如果用户物理机没有独立显卡,就会报错,此种情况下不钩这个选项就可以了。模拟器设置问题,与sdk没关系.

解决:真机测试

 

2.Error:warning: Ignoring InnerClasses attribute for an anonymous inner class

原因:貌似是工程中的方法数量超过安卓规定65536个方法数了

解决:在工程的混淆配置文件 proguard-rules.pro 中加入下面这句代码即可:
-keepattributes EnclosingMethod

 

3.E/AndroidRuntime(9877):     

java.lang.UnsatisfiedLinkError: dalvik.system.PathClassLoader[DexPathList[[zip file "/data/app/com.bdmap.view-1/base.apk"],nativeLibraryDirectories=[/data/app/com.bdmap.view-1/lib/arm64, /data/app/com.bdmap.view-1/base.apk!/lib/arm64-v8a, /vendor/lib64, /system/lib64]]] couldn't find "libBaiduMapSDK_v3_2_0_15.so"

原因:加载不到so库

解决:删除arm64-v8a 文件夹即可。

 

 

4. UnsupportedMethodException
         Unsupported method: AndroidProject.getPluginGeneration().
         The version of Gradle you connect to does not support that method.
         To resolve the problem you can change/upgrade the target version of Gradle you connect to.
         Alternatively, you can ignore this exception and read other information from the model.

原因 : Android Studio升级到最新版本后,没有升级build-tools,无法使用instant run功能,导致运行项目时,报这个错

解决:

1. 关掉 instant run功能 

File - Settings - Build, Execution, Deployment - Instant Run

去掉打勾:Enable Instant Run to hot swap code/resource changes on deploy(default enabled)

2. 升级build-tools 

打开SDK Manager进行更新

 

 

5.  Gradle 'SimpleLineView-master' project refresh failed

Error:This Gradle plugin requires a newer IDE able to request IDE model level 3. For Android Studio this means version 3.0+

原因Gradle插件需要一个更新的IDE来请求IDE模型级别3。对于Android Studio来说,这意味着版本3.0 +

解决: 更新AndroidStudio到响应的版本就行了

 

 

6.使用DataBinding编译报错

错误信息 : Error:Execution failed for task ':app:mergeDebugResources'.

> Error: ****/ data binding error ****msg:Only one layout element and one data element are allowed. C:\Users\Administrator\Desktop\testMVVM\app\src\main\res\layout\activity_main.xml has 2
  file:C:\Users\Administrator\Desktop\testMVVM\app\src\main\res\layout\activity_main.xml

原因 :  xml文件中 节点下的 并列放了

你可能感兴趣的:(android杂记)