maciejgos
maciejgos

Reputation: 103

react-native-maps:processReleaseResources task gradlew build failed

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?

Upvotes: 4

Views: 3477

Answers (3)

Ernest
Ernest

Reputation: 1064

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!!!

Upvotes: 3

Friendly-Robot
Friendly-Robot

Reputation: 1164

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!

Upvotes: 0

maciejgos
maciejgos

Reputation: 103

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

Upvotes: 0

Related Questions