我有一个大的旧项目供 Android 支持。它是在旧的 Gradle 版本(2.2.3)下开发的。我曾经使用最新的 Android Studio,现在我正在尝试将这个项目迁移到当前的 Gradle 版本(3.1.2)。
我已经阅读了谷歌的指南,并从中提出了建议。我设法解决了除两个之外的所有问题。第一个是
WARNING: Configuration 'compile' is obsolete and has been replaced with 'implementation' and 'api'.
我在我的项目中进行了所有替换,据我所知,这是由依赖项中的库引起的。好吧,让我们忍受它。但第二个问题是
error: resource android:attr/foregroundInsidePadding is private. Message{kind=ERROR, text=error: resource android:attr/foregroundInsidePadding is private., sources=[C:\Users\alexanderk.gradle\caches\transforms-1\files-1.1\appcompat-v7-25.1.1.aar\b3fbcbe446f57e45b23f5cfcf67ccbb9\res\values\values.xml:203:5-69], original message=, tool name=Optional.of(AAPT)}*
谷歌的指南对此有以下说法
要解决此问题,只需将 android:foregroundInsidePadding 替换为 foregroundInsidePadding。
没关系,我打开问题文件
values.xml
,转到第 203 行,然后... 令人惊讶的是,这里没有foregroundInsidePadding。而且整个xml中没有这个词。我尝试使 Gradle 缓存无效,但在 Gradle 重新创建缓存后问题再次出现。我不能忽视这一点,因为这个问题停止了。任何想法如何解决这个问题?
最佳答案
appcompat-v7-25.1.1.aar\b3fbcbe446f57e45b23f5cfcf67ccbb9\res\values\values.xml
看起来它提示的不是项目中的 values.xml,而是 appcompat 库中的一个。尝试提升支持库版本
关于android - 将旧项目迁移到 Android Plugin for Gradle 3.1.2,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50612199/