【发布时间】:2020-04-17 04:12:00
【问题描述】:
下面是颤振给出的构建错误,我不知道我做错了什么,我的项目支持 android.x 仍然出现错误,当我在调试模式下运行它时它运行良好,但是当我构建签名时用于发布模式的 apk 它开始给我这个错误,现在真的让我很烦恼超过一天我被困在这个
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':thumbnails:verifyReleaseResources'.
> A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade
> Android resource linking failed
C:\Users\Raja ahmed\.gradle\caches\transforms-2\files-2.1\c1da7862c7abb8e426855a3f78caf221\core-1.0.0\res\values\values.xml:57:5-88:25: AAPT: error: resource android:attr/fontVariationSettings not found.
C:\Users\Raja ahmed\.gradle\caches\transforms-2\files-2.1\c1da7862c7abb8e426855a3f78caf221\core-1.0.0\res\values\values.xml:57:5-88: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 455h 48m 24s
Running Gradle task 'assembleRelease'... 55.9s
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 firebase_admob...
Running Gradle task 'assembleAarRelease'...
The plugin firebase_admob could not be built due to the issue above.
pubspec.yaml
splashscreen: ^1.2.0
firebase_admob: ^0.9.3+1
cupertino_icons: ^0.1.2
share: ^0.6.3+5
url_launcher: ^5.4.1
permission_handler: ^4.0.0
flutter_staggered_grid_view: ^0.3.0
path_provider: ^1.5.1
image_gallery_saver: ^1.2.2
flutter_html: ^0.11.1
flutter_fab_dialer: ^0.1.1
thumbnails: ^1.0.1
chewie: ^0.9.8+1
video_player: ^0.10.5+1
assets:
- assets/loading.gif
- assets/video_loader.gif
- assets/bg1.jpg
build.grade 中的默认配置
defaultConfig {
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
applicationId "com.rajaonceagain.statussaver"
minSdkVersion 21
targetSdkVersion 28
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
multiDexEnabled true
}
我正在寻找这个解决方案已经超过一天了。我只是更新了 Visual Studio 代码,前一天我为其他项目的发布模式制作了一个签名的 apk,它工作得很好,但不知道为什么今天它会导致这个问题
【问题讨论】:
-
试试这个解决方案stackoverflow.com/a/57607026/7235539 并再次构建您的应用程序
-
已经试过没用
-
试试这个解决方案github.com/flutter/flutter/issues/32595#issuecomment-491639786。在您的情况下,您需要检查 android 的所有模块或全局搜索并将所有模块 Gradle 的 targetSdkVersion 更改为 28。然后尝试构建应用程序
-
如果上述解决方案不起作用,也试试这个stackoverflow.com/a/59561400/7235539
标签: android flutter build apk firebase-admob