
同样的代码,之前一直用的android studio3.5没有问题,升级到4.2后运行报错
定位报错的地方在arms的ThirdViewUtil类里的convertAutoView方法中
这里声明了不强制使用 autolayout,如果你的项目里使用到了autolayout 就添加鸿神的依赖:
implementation 'com.zhy:autolayout:1.4.5'
如果没有使用到就将你项目里baseActivity的整个 onCreate() 方法注释掉,或者将 View view = convertAutoView(name, context, attrs); 注释掉返回 super.onCreateView(name, context, attrs)
如果使用的是arms里的baseActivity,修改不了添加 autolayout 依赖就行
下面是文本的错误信息,便于百度搜索匹配:
android4.4版本报以下错误:
java.lang.RuntimeException: Unable to start activity ComponentInfo{xxxx.LoginActivity}: android.view.InflateException: Binary XML file line #24: Error inflating class LinearLayout
android10版本报以下错误:
java.lang.RuntimeException: Unable to start activity ComponentInfo{xxxx.LoginActivity}: android.view.InflateException: Binary XML file line #24 in android:layout/screen_simple: Binary XML file line #24 in android:layout/screen_simple: Error inflating class LinearLayout