迁移到AndroidX后,已经将compileSdkVersion更新为28,但是仍然收到关于fontVariationSettings和ttcIndex的gradle错误

时间:2019-03-01 01:39:43

标签: android gradle flutter

迁移到AndroidX包括新属性fontVariationSettings和ttcIndex。我曾尝试迁移项目(Flutter插件),但在进行gradle构建时遇到以下错误。许多用户与我有相同的gradle错误,但与他们不同的是,我已经

  • 在我的build.gradle中将我的compileSdkVersion升级到28
  • 在gradle.properties中添加了android.useAndroidX = true和android.enableJetifier = true
  • 通过Android Studio重置gradle缓存(无效缓存/重启)

我的控制台输出:

FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:processDebugResources'.
> Android resource linking failed
  /Users/davidmccoy/.gradle/caches/transforms-1/files-1.1/core-1.0.0-beta01.aar/f004b9e22a129b2d333d02089203fb0d/res/values/values.xml:89:5-125:25: AAPT: error: resource android:attr/fontVariationSettings not found.
  /Users/davidmccoy/.gradle/caches/transforms-1/files-1.1/core-1.0.0-beta01.aar/f004b9e22a129b2d333d02089203fb0d/res/values/values.xml:89:5-125:25: AAPT: error: resource android:attr/ttcIndex not found.
  error: failed linking references.
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
* Get more help at https://help.gradle.org
BUILD FAILED in 1s
*******************************************************************************************
The Gradle failure may have been because of AndroidX incompatibilities in this Flutter app.
See https://flutter.dev/docs/development/packages-and-plugins/androidx-compatibility for more information on the problem and how to fix it.
*******************************************************************************************
Gradle task assembleDebug failed with exit code 1

1 个答案:

答案 0 :(得分:0)

结果是,我的Flutter应用程序中包含另一个尚未升级到AndroidX的Android项目。所以我升级了那个项目,问题就解决了。