react-native-background-geolocation
react-native-background-geolocation copied to clipboard
Android is not building
Your Environment
- Plugin version: ^0.6.3
- Platform: Android
- Running in Simulator: YES
- React Native version: 0.62.2
Context
The project is not building for android
Expected Behavior
Should build correctly and generate a .apk and .aab files.
Actual Behavior
Receiving a log error when try to build app:
The option 'android.enableUnitTestBinaryResources' is deprecated.
The current default is 'false'.
It has been removed from the current version of the Android Gradle plugin.
The raw resource for unit test functionality is removed.
Affected Modules: @mauron85_react-native-background-geolocation-common
Possible Fix
I did many tests and I saw is just needed to remove android.enableUnitTestBinaryResources
from gradle.properties
Steps to Reproduce
- Open AndroidStudio
- Try to build app
This is also occurring for me.
@brunogonncalves can yoou elaborate your fix? I'm seeing that error but have not found android.enableUnitTestBinaryResources
EDIT:
Can confirm changing node_modules/@mauron85/react-native-background-geolocation/android/common/gradle.properties
fixes the build issue. It's unclear to me if this will break functionality?
This is also occurring for me. @brunogonncalves can yoou elaborate your fix? I'm seeing that error but have not found
android.enableUnitTestBinaryResources
EDIT: Can confirm changing
node_modules/@mauron85/react-native-background-geolocation/android/common/gradle.properties
fixes the build issue. It's unclear to me if this will break functionality?
For me worked without break any thing, just remove android.enableUnitTestBinaryResources
line from file node_modules/@mauron85/react-native-background-geolocation/android/common/gradle.properties
I put in my project an .sh
file to automatically remove this from the code to help my co-workers.
I fixed it without changing the package's files... I changed the build gradle version from 4.0.1
to 3.4.3
in android/build.gradle
and it worked.
Just add this to settings.gradle file 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')
I created fork to solve this issue. https://github.com/darron1217/react-native-background-geolocation
You can install it by command below
npm install https://github.com/darron1217/react-native-background-geolocation#develop
Just add this to settings.gradle file 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')
Solves this problem
Here is it in a better format:
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')