Flutter: ошибка сборки: сбой выполнения для задачи ': app: processDebugResources'

Все работало нормально до обновления 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

Решения оценены

Спасибо!


person SDS712    schedule 08.06.2020    source источник


Ответы (3)


Наконец, переключение compileSdkVersion & targetSdkVersion с 28 на 29 в android/app/build.gradle файле сработало.

Проверьте и эти решения, которые могут вам помочь: -

​​AAPT: error: attribute android: requestLegacyExternalStorage not found

Flutter: сборка отладки прошла успешно, но выпуск выдает ошибку

person SDS712    schedule 08.06.2020

Перейдите в Файл- ›Структура проекта-› Проект- ›Project SDK и выберите последнюю версию SDK.

Я новичок в разработке приложений flutter и столкнулся с этой проблемой в самом первом приложении, которое я создавал.

person Bhargav Reddy    schedule 11.04.2021

Исправьте это, удалив android:networkSecurityConfig="@xml/network_security_config" из манифеста Android.

person Jeeson    schedule 23.04.2021