颤振生成错误:AAPT:error:resource android:attr/fontVariationSettings,找不到ttcIndex

颤振生成错误:AAPT:error:resource android:attr/fontVariationSettings,找不到ttcIndex,android,flutter,gradle,visual-studio-app-center,Android,Flutter,Gradle,Visual Studio App Center,目前,我们在MS Appcenter上的颤振构建失败,出现以下日志: * What went wrong: Execution failed for task ':appcenter_analytics:verifyReleaseResources'. > A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade > Android resour

目前,我们在MS Appcenter上的颤振构建失败,出现以下日志:

* What went wrong:
Execution failed for task ':appcenter_analytics:verifyReleaseResources'.
> A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade
   > Android resource linking failed
     /Users/runner/.gradle/caches/transforms-2/files-2.1/4bf813c12249ada6f409527e3c5fd194/core-1.0.0/res/values/values.xml:57:5-88:25: AAPT: error: resource android:attr/fontVariationSettings not found.

     /Users/runner/.gradle/caches/transforms-2/files-2.1/4bf813c12249ada6f409527e3c5fd194/core-1.0.0/res/values/values.xml:57:5-88:25: AAPT: error: resource android:attr/ttcIndex not found.
这个问题不能在本地重现,在那里一切正常。只有Appcenter中的生成失败

关于这个问题的大多数答案似乎都是关于
compileSdkVersion
,在我们的项目中它已经是
28
,我甚至尝试将它改为
29
,但都没有用。我已经在Appcenter中设置了一个全新的管道,同样的结果。我已经改变了颤振版本,同样的结果。 appcenter中的颤振医生输出:

Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, v1.12.13+hotfix.8, on Mac OS X 10.14.6 18G3020, locale en)
[!] Android toolchain - develop for Android devices (Android SDK version 29.0.3)
    ! Some Android licenses not accepted.  To resolve this, run: flutter doctor --android-licenses
[✓] Xcode - develop for iOS and macOS (Xcode 11.3.1)
[!] Android Studio (not installed)
[!] Connected device
    ! No devices available

! Doctor found issues in 3 categories.
+ flutter build apk --release
Running "flutter pub get" in s...                                  11.6s
You are building a fat APK that includes binaries for android-arm, android-arm64, android-x64.
If you are deploying the app to the Play Store, it's recommended to use app bundles or split the APK to reduce the APK size.
    To generate an app bundle, run:
        flutter build appbundle --target-platform android-arm,android-arm64,android-x64
        Learn more on: https://developer.android.com/guide/app-bundle
    To split the APKs per ABI, run:
        flutter build apk --target-platform android-arm,android-arm64,android-x64 --split-per-abi
        Learn more on:  https://developer.android.com/studio/build/configure-apk-splits#configure-abi-split
Running Gradle task 'assembleRelease'...                        
Gradle 5.6.4

谢谢

我有一个类似的问题,与一个没有最新编译SDK版本的插件有关。您可以通过更改andoid/build.gradle文件并包括以下内容来强制执行此操作

subprojects {
    afterEvaluate { project ->
        if (project.name == "plugin_that_causes_the_issue") {
            android {
                compileSdkVersion 28
            }
        }
    }
}

在构建颤振应用程序时,我遇到了相同的错误

  • 打开项目结构(文件->项目结构)
  • 然后在Project SDK中选择Android API 29平台
  • 单击“确定”

如果没有,它将解决问题,然后在Android Studio中打开Android模块(工具->颤振->在Android Studio中打开进行编辑)。并尝试从build构建apk

尝试将compileSdkVersion更新为28适合我