flutter - Flutter:构建错误:任务 ':app:processDebugResources'的执行失败

标签 flutter dart androidx flutter-dependencies build-error

在将flutter升级至v1.17.3之前,一切工作正常,

已经尝试过:

flutter clean


flutter downgrade

我收到的错误(构建失败):
FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:processDebugResources'.
> A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade
   > Android resource linking failed
     C:\Users\Shamuvel\Desktop\App Development\PROJECTS\Grocery Store\groci\android\Store\groci\android\app\src\main\AndroidManifest.xml:8:5-47:19: AAPT: error: attribute android:requestLegacyExternalStorage 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 1m 27s
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 path_provider...

FAILURE: Build failed with an exception.

* What went wrong:
A problem occurred configuring root project 'path_provider'.
> 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 5s

Exception: The plugin path_provider could not be built due to the issue above.

gradle.properties文件:
org.gradle.jvmargs=-Xmx1536M
android.enableR8=true
android.useAndroidX=true
android.enableJetifier=true

赞赏的解决方案

谢谢!

最佳答案

最后,将compileSdkVersion文件中的targetSdkVersionandroid/app/build.gradle从28切换为29可以正常工作。

同时检查这些解决方案,可能会帮助您:-

AAPT: error: attribute android:requestLegacyExternalStorage not found

Flutter: Debug build successful but release gives error

关于flutter - Flutter:构建错误:任务 ':app:processDebugResources'的执行失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/62259315/

相关文章:

Flutter Firebase 电话身份验证不发送短信代码。直接调用 PhoneCodeAutoRetrievalTimeout 方法。这是我的代码

dart - 无状态小部件类中的键是什么?

flutter - 为什么我们应该在 dart 中使用 static 关键字代替抽象?

flutter - 当我当时尝试使用火焰引擎加载base64图像时,出现以下错误。我用火焰:^ 0.27.0

androidx 渲染脚本崩溃 "Error loading RS jni library: java.lang.UnsatisfiedLinkError: JNI_ERR returned from JNI_OnLoad"

android - 更新后无法在Android上运行Flutter项目

android - 如何从Firebase返回具有特定变量的文档?

flutter - 如何使用 slider 指示器更改 flutter 上的字体大小?

android - TextInputEditText 的 OutlinedBox 不起作用

android-fragments - AndroidX 中的自定义 ListPreference