Failed to transform artifact opencv.aar
Hello,
I am trying to build a simple app with react native and opencv. but the error appear.
I just create an app with:
npx react-native init AwesomeProject
and it works, then I run this:
npm install react-native-opencv3 --save
then:
npx react-native run-android
and this error:
Task :app:preDebugBuild FAILED 15 actionable tasks: 2 executed, 13 up-to-date
FAILURE: Build failed with an exception.
- What went wrong: Execution failed for task ':app:preDebugBuild'.
Could not resolve all files for configuration ':app:debugRuntimeClasspath'. Failed to transform artifact 'opencv.aar (com.quickbirdstudios:opencv:3.4.4-contrib)' to match attributes {artifactType=android-manifest}. > Execution failed for JetifyTransform: C:\Users\s.dezhahanj.gradle\caches\modules-2\files-2.1\com.quickbirdstudios\opencv\3.4.4-contrib\d90d4b79a287edc4e805cce729d4642b5cd981e0\opencv-3.4.4-contrib.aar. > Java heap space
-
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 12s
error Failed to install the app. Make sure you have the Android development environment set up: https://facebook.github.io/react-native/docs/getting-started.html#android-development-environment. Run CLI with --verbose flag for more details. Error: Command failed: gradlew.bat app:installDebug -PreactNativeDevServerPort=8081
FAILURE: Build failed with an exception.
-
What went wrong: Execution failed for task ':app:preDebugBuild'.
Failed to transform artifact 'opencv.aar (com.quickbirdstudios:opencv:3.4.4-contrib)' to match attributes {artifactType=android-manifest}. > Execution failed for JetifyTransform: C:\Users\s.dezhahanj.gradle\caches\modules-2\files-2.1\com.quickbirdstudios\opencv\3.4.4-contrib\d90d4b79a287edc4e805cce729d4642b5cd981e0\opencv-3.4.4-contrib.aar. > Java heap space
-
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 12s
at checkExecSyncError (child_process.js:611:11)
at execFileSync (child_process.js:629:15)
at runOnAllDevices (D:\Dev\React Native\OpencvTest\node_modules\@react-native-community\cli-platform-android\build\commands\runAndroid\runOnAllDevices.js:94:39)
at buildAndRun (D:\Dev\React Native\OpencvTest\node_modules\@react-native-community\cli-platform-android\build\commands\runAndroid\index.js:158:41)
at D:\Dev\React Native\OpencvTest\node_modules\@react-native-community\cli-platform-android\build\commands\runAndroid\index.js:125:12
at processTicksAndRejections (internal/process/task_queues.js:97:5)
at async Command.handleAction (D:\Dev\React Native\OpencvTest\node_modules\react-native\node_modules\@react-native-community\cli\build\index.js:164:9)
and the app not run what`s the problem??
Specify enableJetify is false in one of the Android config files I don't remember which one. That is in the build instructions for the sample apps I believe. Best regards, Adam
On Sat, Feb 1, 2020, 6:28 AM shdezhahanj [email protected] wrote:
Hello, I am trying to build a simple app with react native and opencv. but the error appear. I just create an app with: npx react-native init AwesomeProject and it works, then I run this: npm install react-native-opencv3 --save then: npx react-native run-android
and this error:
Task :app:preDebugBuild FAILED 15 actionable tasks: 2 executed, 13 up-to-date
FAILURE: Build failed with an exception.
- What went wrong: Execution failed for task ':app:preDebugBuild'.
Could not resolve all files for configuration ':app:debugRuntimeClasspath'. Failed to transform artifact 'opencv.aar (com.quickbirdstudios:opencv:3.4.4-contrib)' to match attributes {artifactType=android-manifest}.
Execution failed for JetifyTransform: C:\Users\s.dezhahanj.gradle\caches\modules-2\files-2.1\com.quickbirdstudios\opencv\3.4.4-contrib\d90d4b79a287edc4e805cce729d4642b5cd981e0\opencv-3.4.4-contrib.aar. Java heap space
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 12s
error Failed to install the app. Make sure you have the Android development environment set up: https://facebook.github.io/react-native/docs/getting-started.html#android-development-environment. Run CLI with --verbose flag for more details. Error: Command failed: gradlew.bat app:installDebug -PreactNativeDevServerPort=8081
FAILURE: Build failed with an exception.
What went wrong: Execution failed for task ':app:preDebugBuild'.
Failed to transform artifact 'opencv.aar (com.quickbirdstudios:opencv:3.4.4-contrib)' to match attributes {artifactType=android-manifest}.
Execution failed for JetifyTransform: C:\Users\s.dezhahanj.gradle\caches\modules-2\files-2.1\com.quickbirdstudios\opencv\3.4.4-contrib\d90d4b79a287edc4e805cce729d4642b5cd981e0\opencv-3.4.4-contrib.aar. Java heap space
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 12s
at checkExecSyncError (child_process.js:611:11) at execFileSync (child_process.js:629:15) at runOnAllDevices (D:\Dev\React Native\OpencvTest\node_modules@react-native-community\cli-platform-android\build\commands\runAndroid\runOnAllDevices.js:94:39) at buildAndRun (D:\Dev\React Native\OpencvTest\node_modules@react-native-community\cli-platform-android\build\commands\runAndroid\index.js:158:41) at D:\Dev\React Native\OpencvTest\node_modules@react-native-community\cli-platform-android\build\commands\runAndroid\index.js:125:12 at processTicksAndRejections (internal/process/task_queues.js:97:5) at async Command.handleAction (D:\Dev\React Native\OpencvTest\node_modules\react-native\node_modules@react-native-community\cli\build\index.js:164:9)
and the app not run what`s the problem??
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/adamgf/react-native-opencv3/issues/12?email_source=notifications&email_token=AAJ6V3ZDJG4LTYZL2FZPLX3RAWBIHA5CNFSM4KOTOH52YY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4IKKYWPA, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAJ6V32KT2PLWLZXHRF26QDRAWBIHANCNFSM4KOTOH5Q .
Thanks for the answer. I did it in gradle.properties
android.useAndroidX=true android.enableJetifier=false
but this error happends:
nfo Running jetifier to migrate libraries to AndroidX. You can disable it using "--no-jetifier" flag. Jetifier found 1007 file(s) to forward-jetify. Using 8 workers... info JS server already running. info Installing the app...
Task :app:processDebugManifest FAILED
See http://g.co/androidstudio/manifest-merger for more information about the manifest merger.
Deprecated Gradle features were used in this build, making it incompatible with Gradle 6.0. Use '--warning-mode all' to show the individual deprecation warnings. See https://docs.gradle.org/5.5/userguide/command_line_interface.html#sec:command_line_warnings 41 actionable tasks: 3 executed, 38 up-to-date C:\Project\code\react Native\myWebRtc\android\app\src\main\AndroidManifest.xml:21:1-90 Error: Element uses-feature#android.hardware.camera.autofocus at AndroidManifest.xml:21:1-90 duplicated with element declared at AndroidManifest.xml:9:1-65 C:\Project\code\react Native\myWebRtc\android\app\src\main\AndroidManifest.xml Error: Validation failed, exiting
FAILURE: Build failed with an exception.
- What went wrong: Execution failed for task ':app:processDebugManifest'.
Manifest merger failed with multiple errors, see logs
-
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 6s
error Failed to install the app. Make sure you have the Android development environment set up: https://facebook.github.io/react-native/docs/getting-started.html#android-development-environment. Run CLI with --verbose flag for more details. Error: Command failed: gradlew.bat app:installDebug -PreactNativeDevServerPort=8081 C:\Project\code\react Native\myWebRtc\android\app\src\main\AndroidManifest.xml:21:1-90 Error: Element uses-feature#android.hardware.camera.autofocus at AndroidManifest.xml:21:1-90 duplicated with element declared at AndroidManifest.xml:9:1-65 C:\Project\code\react Native\myWebRtc\android\app\src\main\AndroidManifest.xml Error: Validation failed, exiting
FAILURE: Build failed with an exception.
- What went wrong: Execution failed for task ':app:processDebugManifest'.
Manifest merger failed with multiple errors, see logs
-
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 6s
at checkExecSyncError (child_process.js:621:11)
at execFileSync (child_process.js:639:15)
at runOnAllDevices (C:\Project\code\react Native\myWebRtc\node_modules\@react-native-community\cli-platform-android\build\commands\runAndroid\runOnAllDevices.js:94:39)
at buildAndRun (C:\Project\code\react Native\myWebRtc\node_modules\@react-native-community\cli-platform-android\build\commands\runAndroid\index.js:179:41)
at C:\Project\code\react Native\myWebRtc\node_modules\@react-native-community\cli-platform-android\build\commands\runAndroid\index.js:133:12
at processTicksAndRejections (internal/process/task_queues.js:85:5)
at async Command.handleAction (C:\Project\code\react Native\myWebRtc\node_modules\react-native\node_modules\@react-native-community\cli\build\index.js:182:9)
What`s wrong please help
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 3s
at makeError (/home/sarvvid/Desktop/SarvvidBox/test_opencv2/node_modules/execa/index.js:174:9)
at /home/sarvvid/Desktop/SarvvidBox/test_opencv2/node_modules/execa/index.js:278:16
at processTicksAndRejections (node:internal/process/task_queues:94:5)
at async runOnAllDevices (/home/sarvvid/Desktop/SarvvidBox/test_opencv2/node_modules/@react-native-community/cli-platform-android/build/commands/runAndroid/runOnAllDevices.js:94:5)
at async Command.handleAction (/home/sarvvid/Desktop/SarvvidBox/test_opencv2/node_modules/@react-native-community/cli/build/index.js:186:9)
info Run CLI with --verbose flag for more details.
Got same error again. Please help