Inflation 开发 Cordova 时出现异常
Inflation Exceptions when developping Cordova
我正在基于 android 库和组件为 android 开发 cordova 插件。在我的许多改编中,我都遇到了 Inflation exception
错误。
我创建了很多与此相关的问题,这是我的最后一个:
https://github.com/wdullaer/MaterialDateTimePicker/issues/524
当我在本机 android 工作室应用程序中使用库时,这些异常不会出现。
在这里,我想问一下 Cordova 插件出现这种错误的潜在原因
你可以git clone https://github.com/wdullaer/MaterialDateTimePicker.git
然后将该项目添加为依赖项,具有固定布局 mdtp_daypicker_group.xml
-
甚至分叉它,修复 layout/styles 然后创建一个拉取请求(将其修复在他们的存储库中)。
android:background="?attr/selectableItemBackgroundBorderless"
最有可能应该是:
android:background="?android:attr/selectableItemBackgroundBorderless"
但随后它抱怨:
?android:attr/selectableItemBackgroundBorderless requires API level 21 (current min is 14)
你要么添加这种风格 res/values-v16/styles.xml
并且可能直到 API 级别 19
(或者甚至直到 28
,在一个不想使用这些资源)-
或者将 minSdkLevel
设置为 21
.
将 selectableItemBackgroundBorderless
添加到 res/values/styles.xml
中也应该使布局工作(没有 android:
前缀),因为这将声明所有 API 级别的样式.. .同时不使用任何 Android SDK 资源。
我正在基于 android 库和组件为 android 开发 cordova 插件。在我的许多改编中,我都遇到了 Inflation exception
错误。
我创建了很多与此相关的问题,这是我的最后一个: https://github.com/wdullaer/MaterialDateTimePicker/issues/524
当我在本机 android 工作室应用程序中使用库时,这些异常不会出现。 在这里,我想问一下 Cordova 插件出现这种错误的潜在原因
你可以git clone https://github.com/wdullaer/MaterialDateTimePicker.git
然后将该项目添加为依赖项,具有固定布局 mdtp_daypicker_group.xml
-
甚至分叉它,修复 layout/styles 然后创建一个拉取请求(将其修复在他们的存储库中)。
android:background="?attr/selectableItemBackgroundBorderless"
最有可能应该是:
android:background="?android:attr/selectableItemBackgroundBorderless"
但随后它抱怨:
?android:attr/selectableItemBackgroundBorderless requires API level 21 (current min is 14)
你要么添加这种风格 res/values-v16/styles.xml
并且可能直到 API 级别 19
(或者甚至直到 28
,在一个不想使用这些资源)-
或者将 minSdkLevel
设置为 21
.
将 selectableItemBackgroundBorderless
添加到 res/values/styles.xml
中也应该使布局工作(没有 android:
前缀),因为这将声明所有 API 级别的样式.. .同时不使用任何 Android SDK 资源。