react-native-background-geolocation
react-native-background-geolocation copied to clipboard
FAILURE: Build completed with 2 failures. after installation of module
Your Environment
- Plugin version: 0.6.3
- Platform: iOS or Android
- OS version: 10
- Device manufacturer and model: Samsung
- Running in Simulator:
- React Native version: 0.66.3
- Plugin configuration options:
- Link to your project:
Context
I want to install the module but I have 2 error when I run android after installation.
Expected Behavior
Actual Behavior
Possible Fix
Steps to Reproduce
-
yarn add @mauron85/react-native-background-geolocation -
node ./node_modules/@mauron85/react-native-background-geolocation/scripts/postlink.js - add
googlePlayServicesVersion = "17.6.0"in ext ofandroid/build.gradle -
npm run android
Context
I tryed the manual setup but there are some errors similar to this.
Debug logs
FAILURE: Build completed with 2 failures.
1: Task failed with an exception.
-----------
* Where:
Script 'C:\Users\emanu\App\DetectApp-copia11\node_modules\@mauron85\react-native-background-geolocation\android\common\VERSIONS.gradle' line: 27
* What went wrong:
A problem occurred evaluating project ':@mauron85_react-native-background-geolocation-common'.
> Could not get unknown property 'android' for project ':app' of type org.gradle.api.Project.
* 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.
==============================================================================
2: Task failed with an exception.
-----------
* What went wrong:
A problem occurred configuring project ':@mauron85_react-native-background-geolocation-common'.
> com.android.builder.errors.EvalIssueException: compileSdkVersion is not specified. Please add it to build.gradle
* 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 10s
Same issue
https://github.com/mauron85/react-native-background-geolocation/issues/500#issuecomment-663829795
add this to your android/settings.gradle
include ':@mauron85_react-native-background-geolocation-common'
project(':@mauron85_react-native-background-geolocation-common').projectDir = new File(rootProject.projectDir, '../node_modules/@mauron85/react-native-background-geolocation/android/common')
include ':@mauron85_react-native-background-geolocation'
project(':@mauron85_react-native-background-geolocation').projectDir = new File(rootProject.projectDir, '../node_modules/@mauron85/react-native-background-geolocation/android/lib')