未找到 AndroidX AAPT 颜色

发布于 2025-01-13 11:25:52 字数 853 浏览 3 评论 0原文

我检查了几个教程,然后深入了解“重构”>“迁移到 AndroidX”。我导入了 ActivityCompat、ContextCompat 和 DrawableCompat。 但现在由于这个错误,我陷入了编译完成的困境: AAPT: C:\Program Data\Android\QiewProjects\DBQiew\app\build\intermediates\incremental\mergeDebugResources\merged.dir\values-v31\values-v31.xml:3:错误:资源 android:color/system_neutral1_1000 未找到。 C:\Program Data\Android\QiewProjects\DBQiew\app\build\intermediates\incremental\mergeDebugResources\merged.dir\values-v31\values-v31.xml:4:错误:找不到资源 android:color/system_neutral1_900。 C:\Program Data\Android\QiewProjects\DBQiew\app\build\intermediates\incremental\mergeDebugResources\merged.dir\values-v31\values-v31.xml:5:错误:找不到资源 android:color/system_neutral1_0。 。 。 。

调查仍在继续,寻找大约 21 件失踪物品。 AndroidX 似乎正在寻找丢失的颜色文件。 我花了几个小时寻找类似的帖子,但没有。我什至尝试过使缓存无效/重新启动,但这没有任何改变。

请向我指出找到丢失文件或禁用对它们的搜索的解释。顺便说一句,我正在使用 Studio 4.1.2 并编译和定位 SDK 版本 29。

I checked a couple of tutorials and then dove in to Refactor>Migrate to AndroidX. I imported ActivityCompat, ContextCompat and DrawableCompat.
But now I am stuck getting a compile completed because of this error:
AAPT: C:\Program Data\Android\QiewProjects\DBQiew\app\build\intermediates\incremental\mergeDebugResources\merged.dir\values-v31\values-v31.xml:3: error: resource android:color/system_neutral1_1000 not found.
C:\Program Data\Android\QiewProjects\DBQiew\app\build\intermediates\incremental\mergeDebugResources\merged.dir\values-v31\values-v31.xml:4: error: resource android:color/system_neutral1_900 not found.
C:\Program Data\Android\QiewProjects\DBQiew\app\build\intermediates\incremental\mergeDebugResources\merged.dir\values-v31\values-v31.xml:5: error: resource android:color/system_neutral1_0 not found.
.
.
.

It continues on for about 21 missing items. It appears AndroidX is looking for color files that are missing.
I have spent hours looking for a similar posting, but there aren't any. I have even tried Invalidate caches/Restart but that changed nothing.

Please point me to an explanation to find the missing files or disable the hunt for them. BTW I am using Studio 4.1.2 and compile and target SDK versions 29.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

删除→记忆 2025-01-20 11:25:52

结果我不得不将compile和targetSDK版本从29修改为31。
这不是强制性的,但我还在 app/build.gradle 中升级了以下版本:

androidx.appcompat.appcompat:1.0.0 -> 1.4.1
androidx.core.core:1.0.0 -> 1.7.0
androidx.constraintlayout.constraintlayout:1.1.2 -> 2.1.3

It turned out I had to revise the compile and targetSDK versions from 29 to 31.
It was not mandatory, but I also upgraded the following versions in app/build.gradle:

androidx.appcompat.appcompat:1.0.0 -> 1.4.1
androidx.core.core:1.0.0 -> 1.7.0
androidx.constraintlayout.constraintlayout:1.1.2 -> 2.1.3
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文