Flutter: Execution failed for task ':background_location:verifyReleaseResources' - android

My app works fine when I run it or build app packages, but when I try to build apk for release or profile, it gives this message:
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':background_location:verifyReleaseResources'.
> A failure occurred while executing com.android.build.gradle.tasks.VerifyLibraryResourcesTask$Action
> Android resource linking failed
ERROR:C:\Users\Misha\AppData\Local\Pub\Cache\hosted\pub.dartlang.org\background_location-0.6.1\android\src\main\AndroidManifest.xml:10:9-15:37: AAPT: error: attribute android:foregroundServiceType not found.
I've already tried flutter clean and flutter pub cache repair, as well as updated my Gradle version. Also, I have AndroidX enabled.
Could somebody please help?
Update: I found a solution here

Related

Execution failed for task ':app:mergeProdReleaseAssets'

I am getting this error while creating appbundle in a flutter projet using the command flutter build appbundle
* What went wrong:
Execution failed for task ':app:mergeDevReleaseAssets'.
> Could not resolve all dependencies for configuration ':app:devReleaseRuntimeClasspath'.
> Could not determine artifacts for com.github.topjohnwu.libsu:core:3.1.2: Skipped due to earlier error
BUILD FAILED in 5m 21s
The flutter sdk version used is 3.0.1 .
Try again with flutter clean it works for me.

Cannot find AndroidManifest when building react-native app for Android

I'm trying to build my react-native app for android. I can build it for iOS without any problem, but I'm having problems with Android.
When I do ./gradlew assembleDebug inside the android folder to generate an apk I receive the following error:
Task :generateDebugBuildConfig FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':generateDebugBuildConfig'.
> Error while evaluating property 'buildConfigPackageName' of task ':generateDebugBuildConfig'
> Failed to calculate the value of task ':generateDebugBuildConfig' property 'buildConfigPackageName'.
> Failed to query the value of property 'packageName'.
> Manifest file does not exist: /Users/user/Desktop/app_name/app_name/android/src/main/AndroidManifest.xml
My AndroidManifest is not present at that path, but in the following path:
/Users/user/Desktop/app_name/app_name/android/app/src/main/AndroidManifest.xml
I know maybe it's a stupid question, but how do I change the location where to search the AndroidManifest?

The built failed likely due to AndroidX incompatibilities in a plugin

Flutter app running in debug mode fine. Errors on releasing the app.
Running Gradle task 'assembleRelease'... 1434.8s (!)
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 android_intent...
Running Gradle task 'assembleAarRelease'... 93.5s
FAILURE: Build failed with an exception.
* What went wrong:
A problem occurred configuring root project 'android_intent'.
What I have tried:
Removed 'android_intent' plugin. After removing, still having the same issue with cloud_firestore.
* What went wrong:
Execution failed for task ':flutter_appavailability:verifyReleaseResources'.
> A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade
> Android resource linking failed
/home/mkmalik/.gradle/caches/transforms-2/files-2.1/fa16a5b23fa3b0f70fd87fe1ad317210/core-1.1.0/res/values/values.xml:142:5-173:25: AAPT: error: resource android:attr/fontVariationSettings not found.
/home/mkmalik/.gradle/caches/transforms-2/files-2.1/fa16a5b23fa3b0f70fd87fe1ad317210/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 6m 38s
Running Gradle task 'assembleRelease'...
Running Gradle task 'assembleRelease'... Done 407.1s (!)
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 cloud_firestore...
The plugin cloud_firestore could not be built due to the issue above.
Updated Gradle to 4.0.1 and compileSdkVersion to 30. And managed to release the app (with 7 warnings from native code). But on the device, it immediately stops (only white screen) after a sec.
Flutter 1.22.5
Problem were with flutter_appavailability.
Just removed and problem solved.

Getting Task :react-native-custom-keyboard-kit:verifyReleaseResources FAILED when building app

I am trying to create a simple app with Custom Keyboard. So I used react-native-custom-keyboard-kit npm package. It has no error when the app running on debugging mode. But when I tried to build app, it occured error as below:
Task :react-native-custom-keyboard-kit:verifyReleaseResources FAILED
FAILURE: Build failed with an exception.
What went wrong:
Execution failed for task ':react-native-custom-keyboard-kit:verifyReleaseResources'.
A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade
Android resource linking failed
/home/bipulroy/.gradle/caches/transforms-2/files-2.1/a4aa75ad6ccbe3ab81ae94031ca63766/appcompat-1.0.2/res/values-v26/values-v26.xml:5:5-8:13: AAPT: error: resource android:attr/colorError not found.
Have you linked the library natively?
Try this:
react-native link react-native-custom-keyboard-kit

Flutter - Error while buiiding the apk in Android Studio

The built failed likely due to AndroidX incompatibilities in a plugin.
The tool is about to try using Jetfier to solve the incompatibility.
I'm using Android Studio for flutter, while building apk, build failed with above exception.
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':path_provider:verifyReleaseResources'.
A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade
Android resource linking failed
/Users/android/.gradle/caches/transforms-2/files-2.1/7faf2ad74a0b9932e38d86e684646e95/core-1.0.0/res/values/values.xml:57:5-88:25:
AAPT: error: resource android:attr/fontVariationSettings not found.
/Users/android/.gradle/caches/transforms-2/files-2.1/7faf2ad74a0b9932e38d86e684646e95/core-1.0.0/res/values/values.xml:57:5-88:25:
AAPT: error: resource android:attr/ttcIndex not found.
What is causing this? Any suggestions would be helpful.
Flutter Clean and update your package path_provider

Categories

Resources