I install react native reanimated 2 according to its installation doc. But when I run project for android build, I get this error:
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:mergeDebugNativeLibs'.
> A failure occurred while executing com.android.build.gradle.internal.tasks.MergeJavaResWorkAction
> 2 files found with path 'lib/x86_64/libreactnativejni.so' from inputs:
- D:\ReactBootCamp_RASAHR\Bootcamp Main Projects\ReactNative\SecondVersion\Fooductor\node_modules\react-native-reanimated\android\build\.transforms\1ebd6d22f25011a79a18acd12f297fc9\transformed\jetified-react-native-reanimated-65-hermes\jni
- C:\Users\Kavosh\.gradle\caches\transforms-3\156e8e6ad84734ffd5fbff137e92dae0\transformed\jetified-react-native-0.65.1\jni
If you are using jniLibs and CMake IMPORTED targets, see
https://developer.android.com/r/tools/jniLibs-vs-imported-targets
How can I solve this?
Related
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.
I followed the instructions to import OpenCV to Android Studio here https://github.com/quickbirdstudios/opencv-android, after Android Studio wouldn't let me use the File > New > Import Module feature. After following the instructions, I get these build errors:
FAILURE: Build completed with 2 failures.
1: Task failed with an exception.
What went wrong:
Execution failed for task ':app:processDebugMainManifest'.
com.android.manifmerger.ManifestMerger2$MergeFailureException: java.io.FileNotFoundException: H:\AndroidProjects\WyzeCloud\Rev1\IPCloud\app\build\intermediates\navigation_json\debug\navigation.json (The system cannot find the file specified)
============================================================================
2: Task failed with an exception.
What went wrong:
Execution failed for task ':app:compressDebugAssets'.
A failure occurred while executing com.android.build.gradle.internal.tasks.CompressAssetsWorkAction
H:\AndroidProjects\WyzeCloud\Rev1\IPCloud\app\build\intermediates\merged_assets\debug\out
============================================================================
BUILD FAILED in 18s
Anyone know what these errors mean, or have a possible solution to importing OpenCV to an Android Studio project?
I faced this problem before and my solution:
Download the Android sdk of Open-CV from this link: https://opencv.org/releases/
Add the java and jni library files into your project. Java functions of this library is works with jni files (.so).
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
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'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