【问题标题】:Flutter Android build failed for task ':auto_orientation:verifyReleaseResources'任务':auto_orientation:verifyReleaseResources'的Flutter Android构建失败
【发布时间】:2020-03-28 12:15:48
【问题描述】:

当我运行命令 flutter build apk --release 时,我会遇到以下 auto_orientation 问题

在我的 pubspec.yaml 文件中,我包含了最新版本 auto_orientation: ^1.0.5

顺便说一句。当我使用flutter run 运行项目时,一切工作正常

FAILURE: Build failed with an exception.                                

* What went wrong:                                                      
Execution failed for task ':auto_orientation:verifyReleaseResources'.   
> java.util.concurrent.ExecutionException: com.android.builder.internal.aapt.v2.Aapt2Exception: Android resource linking failed
  /Users/johannes/flutter_projects/udare/app/build/auto_orientation/intermediates/res/merged/release/values/values.xml:236: error: resource android:attr/fontVariationSettings not found.
  /Users/johannes/flutter_projects/udare/app/build/auto_orientation/intermediates/res/merged/release/values/values.xml:237: error: resource android:attr/ttcIndex not found.
  error: failed linking references.   

颤振医生:

[✓] Flutter (Channel master, v1.12.15-pre.29, on Mac OS X 10.14.6 18G95, locale
    en-DE)
[✓] Android toolchain - develop for Android devices (Android SDK version 29.0.0)
[✓] Xcode - develop for iOS and macOS (Xcode 11.2.1)
[✓] Android Studio (version 3.4)
[✓] VS Code (version 1.40.2)
[✓] Connected device (1 available)

• No issues found!

【问题讨论】:

    标签: flutter flutter-dependencies


    【解决方案1】:

    @GreenTigerEye,这可能是由于 AndroidX 不兼容。您可以直接尝试使用auto_orientation 包的源代码,或者尝试here 提到的几个选项来解决类似问题。

    【讨论】:

    • 谢谢 :) 对于某些插件,我不得不将 compileSdkVersion 设置为 28,就像您链接的资源中描述的那样
    猜你喜欢
    • 2020-11-23
    • 2016-03-02
    • 2019-05-17
    • 2021-12-26
    • 2019-09-25
    • 2019-06-19
    • 2022-01-05
    • 1970-01-01
    相关资源
    最近更新 更多