react-native-background-geolocation: Build failed on Android

Your Environment

  • Plugin version: 0.5.3
  • Platform: Android
  • OS version: Windows 10
  • Device manufacturer and model: Xiaomi Pocophone F1
  • Running in Simulator:
  • React Native version: 0.60.3
  • Plugin configuration options:
  • Link to your project:

Context

I used react-native-mauron85-background-geolocation in my app, with React Native 0.59 yesterday I decided to update my React Native to 0.60.3, and I knew that the new repository is @mauron85/react-native-background-geolocation so I change to this new repository and I used React Native 0.60.3 autolinking and I can’t run it anymore on my device!

FAILURE: Build failed with an exception.

* Where:
Build file 'C:\Users\Mehrdad\Desktop\Tozico\New\app\tozico\node_modules\@mauron85\react-native-background-geolocation\android\lib\build.gradle' line: 98

* What went wrong:
A problem occurred evaluating project ':@mauron85_react-native-background-geolocation'.
> Project with path ':@mauron85_react-native-background-geolocation-common' could not be found in project ':@mauron85_react-native-background-geolocation'.

Expected Behavior

The app should be built correctly!

Actual Behavior

react-native run-android fails!

Possible Fix

Steps to Reproduce

  1. Just start a project, add this library and try to run it on Android.

Context

Debug logs

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Reactions: 5
  • Comments: 19

Most upvoted comments

Just include these in 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')

Hey guys, I had the same problem but noticed that in my settings.grade I had only this:

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

and was missing this:

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

as indicated in the installation guide.

Please check if this is your case too.

How to do on the RN version 0.62.2?

has your problem got fixed?