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?
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
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
When building my Android project in AndroidStudio 3.6.1 I'm getting an error message:
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':mobile:externalNativeBuildCleanDebug'.
> A problem occurred starting process 'command 'C:\Users\myusername\AppData\Local\Android\Sdk\cmake\3.6.4111459\bin\cmake.exe''
cmake is correctly installed but myusername does not exists. Instead, it should be a different folder.
Where can I change the path?
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'm trying to build an ionic app for Android but when I run
ionic cordova run android
I get
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:transformClassesWithDexBuilderForDebug'.
> com.android.build.api.transform.TransformException: java.lang.IllegalStateException: Dex archives: setting .DEX extension only for .CLASS files
Trying to run ./gradlew clean gets me
FAILURE: Build failed with an exception.
* What went wrong:
Could not create service of type ScriptPluginFactory using BuildScopeServices.createScriptPluginFactory().
> Could not create service of type FileHasher using BuildSessionScopeServices.createFileSnapshotter().
I had the same issue but it was resolved. Thanks to information from #notlose at this link https://github.com/oney/react-native-gcm-android/issues/32
Solution:
just remove both 'build' folder in /android and /android/app
and build again with
'react-native run-android' for react-native
'ionic cordova run android' for ionic