【发布时间】:2020-10-17 19:29:25
【问题描述】:
我在使用flutter build apk 导出APK 文件并安装在安卓设备上时遇到问题。
请问如何解决这个错误。
我但是下面有颤振医生的错误。
注意:在模拟器上运行我的项目时,它可以正常工作,但仅在使用 flutter build apk 导出 APK 时才会出现此错误。
我需要你的帮助,
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':sms:verifyReleaseResources'.
> A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade
> 1 exception was raised by workers:
com.android.builder.internal.aapt.v2.Aapt2Exception: Android resource linking failed
C:\Users\lenovo\.gradle\caches\transforms-2\files-2.1\7b4c54b05abfe32c04b6fb9596cf35c8\core-1.1.0\res\values\values.xml:142:5-173:25: AAPT: error: resource android:attr/fontVariationSettings not found.
C:\Users\lenovo\.gradle\caches\transforms-2\files-2.1\7b4c54b05abfe32c04b6fb9596cf35c8\core-1.1.0\res\values\values.xml:142:5-173:25: AAPT: error: resource android:attr/ttcIndex not found.
* 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 12s
Running Gradle task 'assembleRelease'... 13.8s
The built failed likely due to AndroidX incompatibilities in a plugin. The tool is about to try using Jetfier to solve the incompatibility.
Building plugin android_intent...
Running Gradle task 'assembleAarRelease'... 1.8s
√ Built build\app\outputs\repo.
Building plugin firebase_messaging...
Running Gradle task 'assembleAarRelease'...
The plugin firebase_messaging could not be built due to the issue above.
Process finished with exit code 1
颤抖的医生
Doctor summary (to see all details, run flutter doctor -v):
[√] Flutter (Channel stable, 1.20.3, on Microsoft Windows [Version 10.0.18363.1082], locale ar-IQ)
[√] Android toolchain - develop for Android devices (Android SDK version 29.0.2)
[√] Android Studio (version 3.3)
[√] IntelliJ IDEA Community Edition (version 2019.2)
[√] VS Code, 64-bit edition (version 1.33.1)
[√] Connected device (1 available)
• No issues found!
【问题讨论】: