从 Android gradle 插件版本 3.6.4 升级到 4.2.1 后,我得到 attrs.xml:11:4: Invalid value 'null'对于<枚举>枚举>
我尝试将我的 Android 项目 targetSdkVersion 从 30 升级到 31 因此我将 Android gradle 插件 'com.android.tools.build:gradle:3.6.4' 升级为 'com.android.tools.build:gradle:4.2.1'
gradle 版本是 6.7.1
我得到
.../app/src/main/res/values/attrs.xml:11:4: 的值“null”无效。必须是整数。 (--scan 选项)
错误消息启动异常是:org.gradle.api.tasks.TaskExecutionException:任务':app:mergeDemoDebugResources'执行失败。
这是我的attrs.xml文件
<?xml version="1.0" encoding="utf-8"?>
<resources>
<declare-styleable name="GlobalStyleable">
<attr name="title" format="string" />
<attr name="text" format="string" />
<attr name="description" format="string" />
<attr name="enabled" format="boolean" />
<attr name="actionText" format="string" />
<attr name="endIcon" format="reference" />
</declare-styleable>
<declare-styleable name="SimpleEditText">
<attr name="android:enabled" />
<attr name="title" />
<attr name="text" />
<attr name="description" />
<attr name="error" format="string" />
<attr name="endIconMode" />
<attr name="endIconDrawable" />
<attr name="inputType" format="enum">
<enum name="text" value="0x00000001" />
<enum name="password" value="0x00000081" />
<enum name="passwordWithoutKeyboard" value="0x00000081" />
<enum name="number" value="0x00000002" />
</attr>
<attr name="contextMenu" format="enum">
<enum name="full" value="0" />
<enum name="onlyCopy" value="1" />
<enum name="onlyPaste" value="2" />
<enum name="none" value="3" />
</attr>
<attr name="mask" format="enum">
<enum name="phone" value="0" />
<enum name="card" value="1" />
<enum name="bin" value="2" />
<enum name="account" value="3" />
<enum name="symbol2" value="4" />
<enum name="symbol3" value="5 " />
<enum name="smsCode" value="6" />
<enum name="password" value="7" />
</attr>
</declare-styleable>
<declare-styleable name="SimpleEditTextWithStartDrawable">
<attr name="android:enabled" />
<attr name="title" />
<attr name="text" />
<attr name="description" />
<attr name="error" />
<attr name="endIconMode" />
<attr name="endIconDrawable" />
<attr name="inputType" />
<attr name="contextMenu" />
<attr name="mask" />
</declare-styleable>
<declare-styleable name="ProgressButton">
<attr name="android:text" />
<attr name="loading" format="boolean" />
</declare-styleable>
</resources>
请帮助
I tried to upgrade my Android projects targetSdkVersion from 30 to 31
Therefore i upgraded Android gradle plugin 'com.android.tools.build:gradle:3.6.4' to
'com.android.tools.build:gradle:4.2.1'
gradle version is 6.7.1
i got
.../app/src/main/res/values/attrs.xml:11:4: Invalid value 'null' for . Must be an integer. (--scan option)
error message start Exception is: org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':app:mergeDemoDebugResources'.
here is my attrs.xml file
<?xml version="1.0" encoding="utf-8"?>
<resources>
<declare-styleable name="GlobalStyleable">
<attr name="title" format="string" />
<attr name="text" format="string" />
<attr name="description" format="string" />
<attr name="enabled" format="boolean" />
<attr name="actionText" format="string" />
<attr name="endIcon" format="reference" />
</declare-styleable>
<declare-styleable name="SimpleEditText">
<attr name="android:enabled" />
<attr name="title" />
<attr name="text" />
<attr name="description" />
<attr name="error" format="string" />
<attr name="endIconMode" />
<attr name="endIconDrawable" />
<attr name="inputType" format="enum">
<enum name="text" value="0x00000001" />
<enum name="password" value="0x00000081" />
<enum name="passwordWithoutKeyboard" value="0x00000081" />
<enum name="number" value="0x00000002" />
</attr>
<attr name="contextMenu" format="enum">
<enum name="full" value="0" />
<enum name="onlyCopy" value="1" />
<enum name="onlyPaste" value="2" />
<enum name="none" value="3" />
</attr>
<attr name="mask" format="enum">
<enum name="phone" value="0" />
<enum name="card" value="1" />
<enum name="bin" value="2" />
<enum name="account" value="3" />
<enum name="symbol2" value="4" />
<enum name="symbol3" value="5 " />
<enum name="smsCode" value="6" />
<enum name="password" value="7" />
</attr>
</declare-styleable>
<declare-styleable name="SimpleEditTextWithStartDrawable">
<attr name="android:enabled" />
<attr name="title" />
<attr name="text" />
<attr name="description" />
<attr name="error" />
<attr name="endIconMode" />
<attr name="endIconDrawable" />
<attr name="inputType" />
<attr name="contextMenu" />
<attr name="mask" />
</declare-styleable>
<declare-styleable name="ProgressButton">
<attr name="android:text" />
<attr name="loading" format="boolean" />
</declare-styleable>
</resources>
please help
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论