【问题标题】:Flutter: Build Error: Execution failed for task ':app:processDebugResources'Flutter:构建错误:任务':app:processDebugResources'的执行失败
【发布时间】:2020-06-08 09:47:29
【问题描述】:

在将 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

赞赏的解决方案

谢谢!

【问题讨论】:

    标签: flutter dart androidx flutter-dependencies build-error


    【解决方案1】:

    最后,将 android/app/build.gradle 文件中的 compileSdkVersiontargetSdkVersion 从 28 切换到 29 成功了。

    也检查这些解决方案,可能会对您有所帮助:-

    AAPT: error: attribute android:requestLegacyExternalStorage not found

    Flutter: Debug build successful but release gives error

    【讨论】:

      【解决方案2】:

      转到文件->项目结构->项目->项目SDK 并选择最新的 SDK。

      我是 Flutter 应用程序开发的新手,在我构建的第一个应用程序中就遇到了这个问题。

      【讨论】:

        【解决方案3】:

        通过从 android 清单中删除 android:networkSecurityConfig="@xml/network_security_config" 来修复它。

        【讨论】:

          猜你喜欢
          • 2023-04-08
          • 1970-01-01
          • 2019-08-16
          • 2016-08-04
          • 2017-07-23
          • 2019-11-02
          • 2018-08-20
          • 2016-02-21
          相关资源
          最近更新 更多