【发布时间】:2020-02-19 14:19:39
【问题描述】:
我只是想构建一个签名的apk,然后我遇到了很多错误,我意识到大多数可以通过迁移到android X来解决,但是在迁移到androidX后我得到了这个运行时错误:
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.test.hamed/com.test.hamed.cups}: android.view.InflateException: Binary XML file line #18: Binary XML file line #18: Error inflating class android.support.design.widget.AppBarLayout
这里提到的第 18 行是:
<android.support.design.widget.
android:id="@+id/cupsAppBar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:theme="@style/AppTheme.AppBarOverlay">
在 Java 中是 onCretae 中的这一行:
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.cups); // <= this line
.
.
.
我搜索了很多,有人建议添加以下行可以解决问题,但它没有:
implementation 'com.android.support:design:28.0.0'
有什么问题,我该如何解决? 谢谢
【问题讨论】:
-
android X 不会使用任何支持库,请移除 gradle 中的支持并使用 android x 更新包,它会起作用
标签: android android-studio androidx signed-apk