I can not run my react native project. It stucks with this problem.
Maybe related with this issue : https://forum.ionicframework.com/t/android-build-broken-after-gradle-dependencies-update-execution-failed-for-task-processdebugresources-com-android-ide-common-process-processexception-failed-to-execute-aapt/109982/33
But I don't understand how to fix it.
:react-native-mauron85-background-geolocation:processReleaseResources
ERROR: In
ERROR: In
ERROR: In
:react-native-mauron85-background-geolocation:processReleaseResources FAILED
FAILURE: Build failed with an exception.
What went wrong:
Execution failed for task ':react-native-mauron85-background-geolocation:processReleaseResources'.
com.android.ide.common.process.ProcessException: Failed to execute aapt
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: 53.161 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
I`ve found a key for the solution here: https://forum.ionicframework.com/t/android-build-broken-after-gradle-dependencies-update-execution-failed-for-task-processdebugresources-com-android-ide-common-process-processexception-failed-to-execute-aapt/109982/107
What is working for me now:
Update node_modules/react-native-mauron85-background-geolocation/lib/build.gradle and set com.android.support:support-v4:23.+
Just need to update your Android SDK and make sure you have every component required by phonegap / cordova:
cordova requirements
But the best solution remains to restart a new project from scratch.
Generally, it does fix all the issues.
Actually, I have the same problem. If I change com.android.support:support-v4:+ to com.android.support:support-v4:23.+ like in chuece's post, it works.
But I do not like to touch anything inside node_modules obviously. @mauron85 , any ideas? Here is an excerpt of my build.gradle file:
android {
compileSdkVersion 26
buildToolsVersion "26.0.2"
. . .
}
. . .
dependencies {
compile(project(':react-native-google-places')){
exclude group: 'com.google.android.gms', module: 'play-services-base'
exclude group: 'com.google.android.gms', module: 'play-services-places'
exclude group: 'com.google.android.gms', module: 'play-services-location'
}
compile project(':react-native-vector-icons')
compile project(':react-native-device-info')
compile fileTree(dir: "libs", include: ["*.jar"])
compile "com.android.support:appcompat-v7:26.0.1"
compile "com.facebook.react:react-native:+" // From node_modules
compile project(':react-native-facebook-login')
compile(project(':react-native-maps')){
exclude group: 'com.google.android.gms', module: 'play-services-base'
exclude group: 'com.google.android.gms', module: 'play-services-maps'
}
compile 'com.google.android.gms:play-services-base:+'
compile 'com.google.android.gms:play-services-maps:+'
compile 'com.google.android.gms:play-services-places:+'
compile 'com.google.android.gms:play-services-location:+'
compile project(':lottie-react-native')
compile project(':react-native-mauron85-background-geolocation') // <-------------
}
My Android SDK is up-to-date:
@dani-sc Update to latest version, it's been fixed on https://github.com/DerekPark/react-native-background-geolocation/commit/5b7776b04a75007d6d8bd2d830216947ac73a6c0
@LaloHao Thank you for your help. Unfortunately, the repo you've linked is behind roughly 20 days of commits. I'll just fork this repo myself for now until @mauron85 can take a look at it.
I had the same problem and changing from com.android.support:support-v4:+ to compile 'com.android.support:support-v4:23.+' fixed it for me.
Now, I know this is off topic but please kindly advise.
I'm using an old version of this package - 0.2.0-alpha.7, with RN-0.40.0.
I can't upgrade RN right now, so I can't also upgrade this package.
And It's wrong to have this fixed inside my node_modules.
How can I send a PR with the fix for my relevant version when it doesn't appear in the releases list?
@efratyo goto https://github.com/mauron85/react-native-background-geolocation, press on Branch: master and select the Tags tab
@LaloHao Thank you, but I also tried that. my version (0.2.0-alpha.7) does not appear in Tags list either...
I managed to resolve this by pinning the support version library for all android modules using gradle:
configurations.all {
resolutionStrategy.eachDependency { DependencyResolveDetails details ->
// Pin the support library version so that all libraries use the same one
if (details.getRequested().getGroup() == 'com.android.support') {
details.useVersion('25.0.1')
}
}
}
Change 25.0.1 to whatever support version you are using - in @chuece case it was 23.+ for example.
Please Help !!!!!
Error: cmd: Command failed with exit code 1 Error output: Note: Some input files use or override a deprecated API. Note: Recompile with -Xlint:deprecation for details. Note: Some input files use or override a deprecated API. Note: Recompile with -Xlint:deprecation for details. ERROR: In FontFamilyFont, unable to find attribute android:fontVariationSettings ERROR: In FontFamilyFont, unable to find attribute android:ttcIndex FAILURE: Build failed with an exception. * What went wrong: Execution failed for task ':processArmv7DebugResources'. > com.android.ide.common.process.ProcessException: Failed to execute aapt * Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
Project target.
target=android-26
android.library.reference.1=CordovaLib
cordova.gradle.include.1=cordova-plugin-crosswalk-webview/newsbeen-xwalk.gradle
cordova.system.library.2=me.leolin:ShortcutBadger:1.1.17@aar
cordova.system.library.3=com.google.firebase:firebase-messaging:11.0.1
cordova.system.library.4=com.android.support:support-v4:24.1.1+
cordova.gradle.include.2=phonegap-plugin-push/newsbeen-push.gradle
cordova.system.library.5=com.android.support:support-v4:24.1.1+
cordova.system.library.6=com.facebook.android:facebook-android-sdk:4.+
Update your android support version to the latest, then install the gradle release plugin https://github.com/dpa99c/cordova-android-support-gradle-release
Can we update gradle to latest version? should problem removed?
When I check my android platform version --> cordova platform list, I saw I was using an old version. What I did?
1) remove old android platform --> cordova platform rm android
2) add a new version --> cordova platform add [email protected]
But I specified a version that was compatible if my plugins, so I checked the list on
https://github.com/apache/cordova-android/releases and instaled a specific version like this:
ex. cordova plugin platform [email protected]
After that the build worked!!!
Most helpful comment
I`ve found a key for the solution here: https://forum.ionicframework.com/t/android-build-broken-after-gradle-dependencies-update-execution-failed-for-task-processdebugresources-com-android-ide-common-process-processexception-failed-to-execute-aapt/109982/107
What is working for me now:
Update
node_modules/react-native-mauron85-background-geolocation/lib/build.gradleand setcom.android.support:support-v4:23.+