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

Created on 16 Jul 2019  路  17Comments  路  Source: mauron85/react-native-background-geolocation


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

Most helpful comment

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.

All 17 comments

The problem is not with the new repository. It just not works with the new released React Native. There should be a Gradle upgrade problem. Can you fix this for the new React Native? @mauron85

+1 Seeing the same issue, I'm on react 59.

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.

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.

which RN version are you using?

which RN version are you using?

0.59

The problem was with auto-linking and what @pocketcat said fixed the problem. Thanks!

Can anyone solve this problem? My RN version is 0.58.4

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.

which RN version are you using?

thank you, you save my time. I just add new line before 'project(':@mauron85_react-native-background....' in your quotation.

How to do on the RN version 0.62.2?

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.

I get the error:
`Could not compile settings file 'C:\Users\User\\android\settings.gradle'.

startup failed:
settings file 'C:\Users\User\\android\settings.gradle': 4: expecting EOF, found '=' @ line 4, column 127.
ound-geolocation').projectDir = new File`

my settings.gradle looks like:
rootProject.name = '<project name>' apply from: file("../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesSettingsGradle(settings) include ':app' 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') 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')

Thanks for your help (:

How to do on the RN version 0.62.2?

has your problem got fixed?

I has this problem on RN 0.62.2 too

same problem

i see this problem in RN 0.63.3 :((
How can i solve this issue

I get over this error by following manual link for android and keep auto link for ios.

I get over this error by following manual link for android and keep auto link for ios.

many tks

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')
Was this page helpful?
0 / 5 - 0 ratings