android - com.android.support:design:28.0.0 产生错误,因为 Error inflating class TextInputLayout
问题描述
我的应用程序在测试中的所有设备上都可以正常工作,从部署应用程序中,一些大于 SDK 26 的用户收到错误为
膨胀类 TextInputLayout 时出错
我的 build.gradle 文件是
implementation 'com.android.support:appcompat-v7:28.0.0'
implementation 'com.android.support:design:28.0.0'
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
implementation 'com.google.firebase:firebase-crash:16.2.1'
implementation 'com.android.support:support-v4:28.0.0'
implementation 'com.android.support:support-core-ui:28.0.0'
implementation 'com.android.support:cardview-v7:28.0.0'
implementation 'com.android.support:support-vector-drawable:28.0.0'
implementation 'com.android.support:recyclerview-v7:28.0.0'
implementation 'com.rengwuxian.materialedittext:library:2.1.4'
布局文件是
<com.rengwuxian.materialedittext.MaterialEditText
android:id="@+id/edt_username"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="@dimen/dimen_8dp"
android:drawableStart="@drawable/ic_boy"
android:drawablePadding="@dimen/dimen_5dp"
android:hint="@string/usernamehint"
android:inputType="textNoSuggestions"
android:textSize="@dimen/dimen_14sp"
app:met_clearButton="true"
app:met_floatingLabel="highlight"
app:met_primaryColor="@color/colorPrimaryDark" />
<android.support.design.widget.TextInputLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="@dimen/dimen_8dp"
app:passwordToggleEnabled="true"
app:passwordToggleTint="@color/grey">
<android.support.design.widget.TextInputEditText
android:id="@+id/edt_password"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:drawableStart="@drawable/ic_locked"
android:drawablePadding="@dimen/dimen_5dp"
android:gravity="center|start"
android:hint="@string/password"
android:inputType="textPassword|textNoSuggestions"
android:textSize="@dimen/dimen_14sp" />
</android.support.design.widget.TextInputLayout>
我无法找到问题,因为它在测试中运行良好。
请帮我解决这个问题。
解决方案
我建议切换到androidX。可能会解决您的问题
implementation 'androidx.appcompat:appcompat:1.0.2'
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
推荐阅读
- flutter - 当用户尝试放大屏幕时,颤动的网页溢出
- python-3.x - PyQt - QThread 中的信号工作者
- pandas - 转置数据框中除第一列之外的所有列
- jenkins - 詹金斯无法读取 /home/hudson/.ssh/id_rsa
- java - 如何在 Spring Boot 中缓存 CompletableFuture 的值
- xamarin.forms - 从 MaterialPicker Xamarin 表单中删除下划线
- python - 将 apply 的输出保留为 pandas categorical DataFrame 中的 dict
- python - Selenium + Python + Unittest:执行测试时出现错误消息“其他元素会收到点击”
- sql - 如何获取具有类型路径的列的第一个点的坐标
- python - 数据库未在 python scrapy 中使用管道在 sqlite3 中创建