Flutter: Build Error: Execution failed for task ':app:processDebugResources' - flutter

Everything was working fine before upgrading flutter to v1.17.3,
Already tried:
flutter clean
And
flutter downgrade
Error that I'm getting (Build Fail):
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 file:
org.gradle.jvmargs=-Xmx1536M
android.enableR8=true
android.useAndroidX=true
android.enableJetifier=true
Solutions Appreciated
Thanks!

Finally, switching compileSdkVersion & targetSdkVersion from 28 to 29 in android/app/build.gradle file worked.
Check these solutions as well, might help you:-
AAPT: error: attribute android:requestLegacyExternalStorage not found
Flutter: Debug build successful but release gives error

Go to File->Project Structure->Project->Project SDK
and select the latest SDK.
I am a rookie in flutter app development and faced this problem in the very first app I was building.

Fix it with remove android:networkSecurityConfig="#xml/network_security_config" from android manifest.

Related

Could not get unknown property 'ndkVersion' for extension 'flutter' of type FlutterExtension

Issue after flutter upgrade Updated ndk but not working working fine for flutter web but on andorid showing
FAILURE: Build failed with an exception.
Where:
Build file 'D:\flutter practice\Instagramclone\android\app\build.gradle' line: 31
What went wrong:
A problem occurred evaluating project ':app'.
Could not get unknown property 'ndkVersion' for extension 'flutter' of type FlutterExtension.
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 13s
Exception: Gradle task assembleDebug failed with exit code 1
For now, writing like this works fine.
android/app/build.gradle ndkVersion "23.1.7779620"
https://developer.android.com/ndk/downloads

NDK not configured. Download it with SDK manager when compile flutter app

Today when I compile the flutter(2.5.1) app, show error like this:
FAILURE: Build failed with an exception.
* What went wrong:
A problem occurred configuring project ':system_clock'.
> NDK not configured. Download it with SDK manager. Preferred NDK version is '21.1.6352462'.
* 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 1s
Exception: Gradle task assembleDebug failed with exit code 1
I have already checked the NDK configuration and make sure the version is installed:
why the project prefer another version of NDK version? what should I do to configure the right version of NDK?
Just check '21.1.6352462' in NDK and press ok.
It'll do the rest.
Or check this issue
https://github.com/flutter/flutter/issues/53657

Could not get unknown property 'flutter' for extension 'android' of type com.android.build.gradle.internal.dsl.BaseAppModuleExtension

1. I treid uninstalling android studio and reinstalling latest version of android studio.
2. tried changing sdk version.
3.even tried changing dependy
and what not
it's been 2 days since i'm trying to solve this error. please help me to get over this
FAILURE: Build failed with an exception.
Where:
Build file 'C:\Users\91893\StudioProjects\kuk\android\app\build.gradle' line: 29
What went wrong:
A problem occurred evaluating project ':app'.
Could not get unknown property 'flutter' for extension 'android' of type com.android.build.gradle.internal.dsl.BaseAppModuleExtension.
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 1s
Exception: Gradle task assembleDebug failed with exit code 1

flutter app apk is giving clipboard_manager error

I am trying to build an apk of my flutter app, but when I run this command
flutter build apk
I encounter the following error;
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':clipboard_manager:verifyReleaseResources'.
> A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade
> Android resource linking failed
/home/username/.gradle/caches/transforms-2/files-2.1/a528b13ac93e64cafa3d0480e2c93207/core-1.1.0/res/values/values.xml:142:5-173:25: AAPT: error: resource android:attr/fontVariationSettings not found.
/home/username/.gradle/caches/transforms-2/files-2.1/a528b13ac93e64cafa3d0480e2c93207/core-1.1.0/res/values/values.xml:142:5-173: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 9s
Running Gradle task 'assembleRelease'...
Running Gradle task 'assembleRelease'... Done 10.1s
The build failed likely due to AndroidX incompatibilities in a plugin. The tool is about to try using Jetifier to solve the
incompatibility.
Building plugin clipboard_manager...
Running Gradle task 'assembleAarRelease'...
Running Gradle task 'assembleAarRelease'... Done 741ms
FAILURE: Build failed with an exception.
* What went wrong:
A problem occurred configuring root project 'clipboard_manager'.
> 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 0s
The plugin clipboard_manager could not be built due to the issue above.
I am getting the flutter pub outdated --mode=null-safety
Package Name Current Upgradable Resolvable Latest
direct dependencies:
clipboard_manager ✗0.0.4 ✗0.0.4 ✗0.0.4 ✗0.0.4
cupertino_icons ✗0.1.3 ✗0.1.3 ✓1.0.3 ✓1.0.3
dio ✗3.0.10 ✗3.0.10 ✓4.0.0 ✓4.0.0
flutter_circular_chart ✗0.1.0 ✗0.1.0 ✗0.1.0 ✗0.1.0
flutter_secure_storage ✗3.3.5 ✗3.3.5 ✓4.2.0 ✓4.2.0
flutter_svg ✗0.19.3 ✗0.19.3 ✓0.22.0 ✓0.22.0
http ✗0.12.2 ✗0.12.2 ✓0.13.3 ✓0.13.3
image_picker ✗0.6.5+3 ✗0.6.5+3 ✓0.8.0+3 ✓0.8.0+3
logger ✗0.9.4 ✗0.9.4 ✓1.0.0 ✓1.0.0
provider ✗4.3.3 ✗4.3.3 ✓5.0.0 ✓5.0.0
8 dependencies are constrained to versions that are older than a resolvable version.
To update these dependencies, edit pubspec.yaml, or run `flutter pub upgrade --null-safety`.
I have searched for it, and they told to change the flutter.sdk, to home.username/Android/Sdk I did this, but after running the buiuld command I got home/lechat/snap/flutter/common/flutter in flutter.sdk in local.properties.
I do not know what the problem actually is. Kindly halp me with this problem. If you any other information I am ready to share it.
I have also followed this question, related problem
but still getting the same error.
Check this similar question there are multiple answers and all of them seem to get the work done, only one of them uses clipboard_manager though.

imagepicker won't let me run my app on android, on IOS it works fine

When I run my app in ios simulation everything works fine, but on android I have an error I think with image picker and gradle here is the error :
I tried the mutlidex solution but it does not seem to work.
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':image_picker:compileDebugJavaWithJavac'.
> Compilation failed; see the compiler error output for details.
* 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 44s
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 image_picker...
> Configure project :
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 'imagepicker'.
> 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 7s
Exception: The plugin image_picker could not be built due to the issue above.