I check already all similar answers from Stack and also I lookup on GitHub Issues but without any luck.
Problem occur when I install react-native-maps plugin, during a build I receive gradlew exception
:react-native-maps:processReleaseResources FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':react-native-maps:processReleaseResources'.
> com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command 'C:\Program Files (x86)\Android\android-sdk\build-tools\23.0.3\aapt.exe'' finished with non-zero exit value 1
Google Maps API is correctly added into AndroidManifest file.
One additional remark I see also many warnings like
...\node_modules\react-native-maps\android\build\intermediates\exploded-aar\com.google.android.gms\play-services-base\9.8.0\res\drawable\common_google_signin_btn_text_light_focused.xml:14:29-81 : No resource found that matches the given name (at 'drawable' with value '#drawable/common_google_signin_btn_text_light_normal').
However in build.gradle I add dependencies for
compile 'com.google.android.gms:play-services-base:10.0.1'
Any ideas how to resolve a problem?
I had the same error recently and should have paid more attention to the error message. Message clearly states it out. Failure to execute aapt
Short Answer:
Make aapt executable
Slightly Longer Answer:
1) Run cd android && ./gradlew clean && ./gradlew assembleDebug --stacktrace. The output will show the build-tool version where you will locate the right aapt to make executable and the path to it. e.g Cannot run program "/home/user/Android/Sdk/build-tools/25.0.3/aapt" (in directory "/home/user/testproject/node_modules/react-native-maps/lib/android"): error=13, Permission denied
2) Right click on file 'aapt', click on permissions, click the checkbox marked 'Execute'
3) Run ./gradlew clean && ./gradlew assembleDebug again and you should be good to go!!!
Problem solved.
An issue is a to long file path and npm not properly install react-native-maps module (there wasn't all required resource files).
During "compilation"
react-native run-android
gradlew task fails du to missing resources in maps module
I experienced a similar issue with this error response:
:react-native-maps:processReleaseResources FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':react-native-maps:processReleaseResources'.
> com.android.ide.common.process.ProcessException: Failed to execute aapt
The way I was able to resolve this error was by going into folder node_modules/react-native-maps/lib/android and editing the build.gradle file with the corresponding compileSdkVersion, buildToolsVersion, minSdkVersion, and targetSdkVersion from my {root}/android/app level build.gradle versions.
This fix worked in various other newly installed packages which caused an error upon attempting to react-native run-android. Hope this helps!
Related
FAILURE: Build failed with an exception.
What went wrong:
Could not determine the dependencies of task ':app:mergeDebugAssets'.
Could not resolve all task dependencies for configuration ':app:debugRuntimeClasspath'.
Could not resolve com.facebook.react:react-native:+.
Failed to list versions for com.facebook.react:react-native.
Try clean gradlew with command:
./gradlew clean
I am building a mobile application using React-Native. I am now trying to run my application on Android Emulator. First, this is the continuation of this question. I installed the Android Studio and configured the environment as I mentioned in the previous question.
This is what I did to fix the error from previous question.
I changed the line 13 in android/gradle.properties to this:
org.gradle.jvmargs=-Xmx2048m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8
When I run "react-native run-android" command this time, I am getting the error. The error is saying it could not find '/Users/waihein/Desktop/Code/shar-kya-mal-app/node_modules/#react-native-community/cli-platform-android/native_modules.gradle' file.
So I run npm i #react-native-community/cli-platform-android command to install the required package.
The I delete node_modules folder and run "npm install" again. Then I run "react-native run-android". I am getting the following error this time.
* Where:
Settings file '/Users/waihein/Desktop/Code/shar-kya-mal-app/android/settings.gradle' line: 8
* What went wrong:
A problem occurred evaluating settings 'sharkyamalapp'.
> Could not open dsl generic class cache for script '/Users/waihein/Desktop/Code/shar-kya-mal-app/node_modules/#react-native-community/cli-platform-android/native_modules.gradle' (/Users/waihein/.gradle/caches/6.8/scripts/a43tr593rdpk11ispliu0nu14).
> BUG! exception in phase 'semantic analysis' in source unit '_BuildScript_' Unsupported class file major version 61
But the file is there I can see it in the node_modules folder. How can I fix it?
I have created my first React Native (Android Wear OS) project and I cannot build it.
I don't understand why the path is linked twice. Can someone help me, please?
rnv run -p androidwear - ERRROR! COMMAND:
gradlew.bat assembleDebug -x bundleReleaseJsAndAssets
FAILED with ERROR:
FAILURE: Build failed with an exception.
What went wrong:
A problem occurred configuring project ':app'.
The SDK directory 'C:\Users\Dado\Desktop\mojaprva\platformBuilds\helloWorld_androidwear\Users\Dado\AppData\Local\Android\sdk' does not exist.
I am running a React-Native app but when I try to gradlew installDebug in the android directory I get a build failure. Here is the info I get when I use:
gradlew installDebug --info
`BUILD FAILED
Total time: 1.118 secs
Stopped 0 compiler daemon(s).
Received result CommandFailure[value=org.gradle.launcher.exec.ReportedException: org.gradle.internal.exceptions.LocationAwareException: A problem occurred configuring project ':app'.] from daemon DaemonInfo{pid=4326, address=[4c8a3b8f-5957-4911-b262-0e36824d2139 port:54258, addresses:[/0:0:0:0:0:0:0:1, /127.0.0.1]], idle=true, context=DefaultDaemonContext[uid=dbec8c34-89ba-4872-9077-12b4b3ff38a0,javaHome=/Library/Java/JavaVirtualMachines/jdk1.8.0_66.jdk/Contents/Home,daemonRegistryDir=/Users/d0ntg0m0ng/.gradle/daemon,pid=4326,idleTimeout=10800000,daemonOpts=-XX:MaxPermSize=256m,-XX:+HeapDumpOnOutOfMemoryError,-Xmx1024m,-Dfile.encoding=UTF-8,-Duser.country=US,-Duser.language=en,-Duser.variant]}.`
This is the error I get when I run gradlew installDebug without --info
`android [router] :> ./gradlew installDebug
FAILURE: Build failed with an exception.
What went wrong:
A problem occurred configuring project ':app'.
Cannot evaluate module react-native-couchbase-lite : Configuration with name 'default' not found.`
"react-native": "^0.15.0", is the version of react-native I am using.
this is the repo that the project is fork from
I am trying to setup the app to my genymotion emulator but the build never finishes.
I have already run the commands to react-native start and set up the sync to the couchbase lite server. Not sure if this is relevant info. I am fairly new to native development and I have no idea where to start with trying to debug this.
include ':app'
include ':react-native-couchbase-lite'
project(':react-native-couchbase-lite').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-couchbase-lite/android')
check the file path
I'm trying to get set up using https://github.com/brentvatne/react-native-video for an android version of a react-native app. After making all the changes to the various gradle files I'm running into this issue below.
I'm a bit of a novice with Android development, and I think I'm just making a silly mistake which is why I'm asking the question here rather than raising an issue. Any advice would be appreciated!
$ react-native run-android
JS server already running.
Building and installing the app on the device (cd android && ./gradlew installDebug)...
FAILURE: Build failed with an exception.
* What went wrong:
A problem occurred configuring project ':app'.
> Cannot evaluate module RCTVideo : Configuration with name 'default' not found.
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
BUILD FAILED
Total time: 0.851 secs
Could not install the app on the device, read the error above for details.
Make sure you have an Android emulator running or a device connected and have
set up your Android development environment:
https://facebook.github.io/react-native/docs/android-setup.html
Edit, settings.gradle looks like this:
rootProject.name = 'app_name'
include ':RCTVideo', ':app'
project(':RCTVideo').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-video/android')
Without seeing the Settings.gradle my guess would be that the project location isn't going into the folder that has the gradle for the android version of the library. I would recommend added /android at the end of the path if it isn't there already.
I will update this answer when the Settings.gradle is provided.
-- Edit after additional information provided --
The version available on NPM is from 3 months ago. It looks like they didn't start adding Android support till Oct 30th and have continued working on it. As such you likely don't actually have the Android code in your node_modules folder. You can either wait till they push an update to NPM or install directly from the git repo. If you go the route of installing directly from the git repo you might want to tag it with a specific commit so you don't keep getting the latest every time you do a npm install.