react-native-background-geolocation icon indicating copy to clipboard operation
react-native-background-geolocation copied to clipboard

FAILURE: Build completed with 2 failures. after installation of module

Open EmanueleAgo opened this issue 3 years ago • 3 comments

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

  1. yarn add @mauron85/react-native-background-geolocation
  2. node ./node_modules/@mauron85/react-native-background-geolocation/scripts/postlink.js
  3. add googlePlayServicesVersion = "17.6.0" in ext of android/build.gradle
  4. 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

EmanueleAgo avatar Feb 24 '22 10:02 EmanueleAgo

Same issue

zero2603 avatar Mar 11 '22 14:03 zero2603

https://github.com/mauron85/react-native-background-geolocation/issues/500#issuecomment-663829795

DanDance avatar Apr 15 '22 04:04 DanDance

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')

enriqueFcoG avatar May 31 '22 19:05 enriqueFcoG