2 回答
TA贡献1890条经验 获得超9个赞
在您的应用程序 Gradle 文件中,检查implementation 'com.android.support:design:28.0.0'
您的dependencies
TA贡献1804条经验 获得超3个赞
查看您的 Logcat,它显示了问题所在。
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.myapplication/com.example.myapplication.MainActivity}: android.view.InflateException: Binary XML file line #9: Binary XML file line #9: Error inflating class android.support.design.widget.AppBarLayout
...
Caused by: java.lang.ClassNotFoundException: Didn't find class "android.support.design.widget.AppBarLayout" on path: DexPathList[[zip file "/data/app/com.example.myapplication-y9OZiywnTa-bCM9Op2luAw==/base.apk"],nativeLibraryDirectories=[/data/app/com.example.myapplication-y9OZiywnTa-bCM9Op2luAw==/lib/arm, /system/lib, /vendor/lib]]
所以,这意味着它无法启动您的活动MainAcitivty,因为它找不到类AppBarLayout。您可能缺少依赖项。
添加回答
举报