gpt4 book ai didi

android - 构建发布失败 Flutter

转载 作者:行者123 更新时间:2023-12-03 03:04:40 25 4
gpt4 key购买 nike

我正在尝试用 flutter 构建apk。但每次我运行flutter build apkflutter build apk --release构建总是失败,并出现这样的异常。

Running Gradle task 'assembleRelease'...                                
Removed unused resources: Binary resource data reduced from 44KB to 35KB: Removed 20%

FAILURE: Build failed with an exception.

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

C:\Users\naonv\.gradle\caches\transforms-2\files-2.1\0a271e99b6771ad4a84318244d532fb7\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 5m 12s
Running Gradle task 'assembleRelease'...
Running Gradle task 'assembleRelease'... Done 315.2s (!)
The built failed likely due to AndroidX incompatibilities in a plugin. The tool is about to try using Jetfier to solve the incompatibility.
✏️ Creating `android\settings_aar.gradle`... 178ms
√ `android\settings_aar.gradle` created successfully.
Building plugin webview_flutter...
Running Gradle task 'assembleAarRelease'...
Running Gradle task 'assembleAarRelease'... Done 37.6s
Starting a Gradle Daemon, 1 incompatible and 1 stopped Daemons could not be reused, use --status for details
WARNING: The option setting 'android.enableR8=true' is experimental and unsupported.
The current default is 'false'
Consider disabling R8 by removing 'android.enableR8=true' from your gradle.properties before publishing your app.


FAILURE: Build failed with an exception.

* What went wrong:
A problem occurred configuring root project 'webview_flutter'.
> SDK location not found. Define location with sdk.dir in the local.properties file or with an ANDROID_HOME environment variable.

* 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 36s


The plugin webview_flutter could not be built due to the issue above.

这也发生在 flutter 示例应用程序中,也许我的设置有问题,但我不知道我需要编辑哪个,有人知道如何解决这个问题吗?

最佳答案

  • 在android studio中打开android文件夹项目
  • 设置应用程序在发布时构建变体
  • 安卓工作室菜单 -> 生成签名包 -> 生成 keystore apk
  • 关于android - 构建发布失败 Flutter,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/60095550/

    25 4 0
    Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
    广告合作:1813099741@qq.com 6ren.com