Android Studio错误集锦
1.Instant Run Error(Android Studio项目用真机跑时提示错误如下):
Instant Run requires that the platform corresponding to your target device (Android 7.0 (Nougat)) is installed.
即时运行在手机上需要有已安装的和目标设备相匹配的sdk platform版本。点击Install and Run,就会下载安装到sdk的platform文件夹中。
2.ClassNotFoundException:"com.android.tools.fd.runtime.BootstrapApplication"
即时运行错误:
java.lang.RuntimeException: Unable to create application com.android.tools.fd.runtime.BootstrapApplication: java.lang.IllegalStateException: java.lang.NoSuchFieldException: No field mAssets in class Landroid/content/res/MiuiResourcesImpl; (declaration of 'android.content.res.MiuiResourcesImpl' appears in /system/framework/framework.jar)
Caused by: java.lang.IllegalStateException: java.lang.NoSuchFieldException: No field mAssets in class Landroid/content/res/MiuiResourcesImpl; (declaration of 'android.content.res.MiuiResourcesImpl' appears in /system/framework/framework.jar)
Caused by: java.lang.NoSuchFieldException: No field mAssets in class Landroid/content/res/MiuiResourcesImpl; (declaration of 'android.content.res.MiuiResourcesImpl' appears in /system/framework/framework.jar)
解决方法:
参考链接
3.Unable to inflate view tag without class attribute.
inflate error.png
错误原因是布局文件写错,有一处使用View标签的地方写成了view(注意大小写)。