Android SmartRefreshLayout闪退 Error inflating class com.scwang.smartrefresh.layout.SmartRefreshLayout

Android使用SmartRefreshLayout框架闪退(可能太快了,刚安装好就崩掉了)
在这里插入图片描述
在这里插入图片描述
Caused by: android.view.InflateException: Binary XML file line #6: Binary XML file line #6: Error inflating class com.scwang.smartrefresh.layout.SmartRefreshLayout Caused by: android.view.InflateException: Binary XML file line #6: Error inflating class com.scwang.smartrefresh.layout.SmartRefreshLayout Caused by: java.lang.ClassNotFoundException: Didn't find class "com.scwang.smartrefresh.layout.SmartRefreshLayout" on path: DexPathList[[zip file "/data/app/com.example.refresh2-2/base.apk"],nativeLibraryDirectories=[/data/app/com.example.refresh2-2/lib/x86, /system/lib, /vendor/lib]]
我还特意的去在线翻译了一下,主要原因就是没有找到com.scwang.smartrefresh.layout.SmartRefreshLayout

首先Binary XML file line #7: Binary XML file line #7: 检查xml中第7行有没有写错,检查依赖是否有效添加。
重新
在这里插入图片描述

在这里插入图片描述

android.useAndroidX=true
android.enableJetifier=true

原因:
如果使用 AndroidX 先在 gradle.properties 中添加,两行都不能少
android.useAndroidX=true
android.enableJetifier=true

猜你喜欢

转载自blog.csdn.net/qq_46906413/article/details/126334049