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.
Related
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
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.
GitHub action build failed with the below exception
> Task :app:spotlessKotlinCheck FAILED
FAILURE: Build failed with an exception.
What went wrong:
Execution failed for task ':app:spotlessKotlinCheck'.
The following files had format violations:
app/src/androidTest/java/com/example/androiddevchallenge/ExampleInstrumentedTest.kt
While I running this locally
./gradlew :app:spotlessKotlinCheck
It shows build success.
How to fix this?
I want to make an Android app with Flutter that uses the firebase ml kit to perform text recognition on images. I have successfully added firebase to my flutter project, but as soon as I add the packages image_picker: 0.6.1+4 and firebase_ml_vision: 0.9.2+1 I get the following error:
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:transformClassesWithDexBuilderForDebug'.
> com.android.build.api.transform.TransformException: com.android.builder.dexing.DexArchiveBuilderException: com.android.builder.dexing.DexArchiveBuilderException: Failed to process C:\Users\mathi\.gradle\caches\transforms-1\files-1.1\firebase-analytics-impl-11.4.2.aar\266afe38e9d564b66b359ca5823523b4\jars\classes.ja
The error also occures when I add only one of the two packages.
Update build.gradle to com.android.tools.build:gradle:3.6.0 and do flutter run -v in your build in editor terminal. Because maybe you have to update your gradle-wrapper.properties too in your android folder.
I did the following
react-native init project-name
yarn add react-navigation react-native-gesture-handler and
react-native run-android
The dependencies installed successfully but the app failed to build with the following errors
> Task :react-native-gesture-handler:packageDebugResources FAILED
17 actionable tasks: 8 executed, 9 up-to-date
> FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':react-native-gesture-handler:packageDebugResources'.
> Could not resolve all files for configuration ':react-native-gesture-handler:_
internal_aapt2_binary'.
> Failed to transform artifact 'aapt2-windows.jar (com.android.tools.build:aa
pt2:3.4.1-5326820)' to match attributes {artifactType=_internal-android-aapt2-bi
nary, org.gradle.usage=java-runtime-jars}.
> org.gradle.api.GradleException: Could not read path 'C:\Users\DevLewa\.g
radle\caches\transforms-2\files-2.1\3d408b3640f7dfba25695085d22596b0\aapt2-3.4.1
-5326820-windows'.
I have searched all through github issues but found no helping information, how do I resolve this, I have being on it since morning today.
Thanks
I had the same problem with some of my initialized projects using reac-native cli. it would be solved by running: react-native link in your project directory. I hope it would work for you as me.
If it was helpful please vote me up:)