Task :react-native-geolocation-service:compileDebugRenderscript FAILED
FAILURE: Build failed with an exception.
I got this problem after updating react native to 0.59.3
You probably did not update android folder, support library version should be 28 I think. This is the RN 0.59 config
ext {
buildToolsVersion = "28.0.3"
minSdkVersion = 16
compileSdkVersion = 28
targetSdkVersion = 28
supportLibVersion = "28.0.0"
}
Example project is updated with RN 0.59. Closing this, feel free to reopen if problem persists.
Hi @Agontuk , I have the same problem with 0.60. My project build.gradle ext is same as your:
buildscript {
ext {
buildToolsVersion = "28.0.3"
minSdkVersion = 16
compileSdkVersion = 28
targetSdkVersion = 28
supportLibVersion = "28.0.0"
}
repositories {
google()
jcenter()
}
dependencies {
classpath("com.android.tools.build:gradle:3.4.1")
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
mavenLocal()
maven {
// All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
url("$rootDir/../node_modules/react-native/android")
}
maven {
// Android JSC is installed from npm
url("$rootDir/../node_modules/jsc-android/dist")
}
google()
jcenter()
}
}
Below is the error log:
ERROR: Unable to resolve dependency for ':react-native-geolocation-service@debug/compileClasspath': Could not resolve com.android.support:appcompat-v7:26.1.0.
Show Details
Affected Modules: react-native-geolocation-service
ERROR: Unable to resolve dependency for ':react-native-geolocation-service@debug/compileClasspath': Could not resolve androidx.appcompat:appcompat:{strictly 1.0.0}.
Show Details
Affected Modules: react-native-geolocation-service
ERROR: Unable to resolve dependency for ':react-native-geolocation-service@debug/compileClasspath': Could not resolve androidx.core:core:{strictly 1.0.0}.
Show Details
Affected Modules: react-native-geolocation-service
ERROR: Unable to resolve dependency for ':react-native-geolocation-service@debug/compileClasspath': Could not resolve androidx.vectordrawable:vectordrawable:{strictly 1.0.0}.
Show Details
Affected Modules: react-native-geolocation-service
ERROR: Unable to resolve dependency for ':react-native-geolocation-service@debug/compileClasspath': Could not resolve androidx.appcompat:appcompat:1.0.2.
Show Details
Affected Modules: react-native-geolocation-service
ERROR: Unable to resolve dependency for ':react-native-geolocation-service@debug/compileClasspath': Could not resolve androidx.core:core:1.0.1.
Show Details
Affected Modules: react-native-geolocation-service
ERROR: Unable to resolve dependency for ':react-native-geolocation-service@debug/compileClasspath': Could not resolve androidx.vectordrawable:vectordrawable:1.0.1.
Show Details
Affected Modules: react-native-geolocation-service
ERROR: Unable to resolve dependency for ':react-native-geolocation-service@debug/compileClasspath': Could not resolve androidx.core:core:1.0.0.
Show Details
Affected Modules: react-native-geolocation-service
ERROR: Unable to resolve dependency for ':react-native-geolocation-service@debug/compileClasspath': Could not resolve androidx.vectordrawable:vectordrawable:1.0.0.
Show Details
Affected Modules: react-native-geolocation-service
Please let me know if you have a way to solve it. Thank you in advance!
@truongluong1314520, RN 0.60 needs support for androidX. I'll try fixing this as soon as possible.
@truongluong1314520, RN 0.60 needs support for androidX. I'll try fixing this as soon as possible.
Have news?
@truongluong1314520, RN 0.60 needs support for androidX. I'll try fixing this as soon as possible.
Have news?
https://github.com/Agontuk/react-native-geolocation-service/pull/92
Tried with changes in #92:
"react-native-geolocation-service": "https://github.com/Agontuk/react-native-geolocation-service.git#47cc3448908a95f473e2bd36196e6393bcfb6ca5"
And this is what I get as error:
node_modules/react-native-geolocation-service/android/src/main/java/com/agontuk/RNFusedLocation/LocationUtils.java:8: error: cannot find symbol
import android.support.v4.app.ActivityCompat;
^
symbol: class ActivityCompat
location: package android.support.v4.app
node_modules/react-native-geolocation-service/android/src/main/java/com/agontuk/RNFusedLocation/LocationUtils.java:21: error: cannot find symbol
return ActivityCompat.checkSelfPermission(context, Manifest.permission.ACCESS_FINE_LOCATION) == PackageManager.PERMISSION_GRANTED ||
This is my configuration in app/build.gradle:
implementation(project(':react-native-geolocation-service')) {
exclude group: 'com.google.android.gms', module: 'play-services-location'
}
implementation 'androidx.appcompat:appcompat:1.1.0-rc01'
Tried with changes in #92:
"react-native-geolocation-service": "https://github.com/Agontuk/react-native-geolocation-service.git#47cc3448908a95f473e2bd36196e6393bcfb6ca5"And this is what I get as error:
node_modules/react-native-geolocation-service/android/src/main/java/com/agontuk/RNFusedLocation/LocationUtils.java:8: error: cannot find symbol import android.support.v4.app.ActivityCompat; ^ symbol: class ActivityCompat location: package android.support.v4.app node_modules/react-native-geolocation-service/android/src/main/java/com/agontuk/RNFusedLocation/LocationUtils.java:21: error: cannot find symbol return ActivityCompat.checkSelfPermission(context, Manifest.permission.ACCESS_FINE_LOCATION) == PackageManager.PERMISSION_GRANTED ||This is my configuration in app/build.gradle:
implementation(project(':react-native-geolocation-service')) { exclude group: 'com.google.android.gms', module: 'play-services-location' } implementation 'androidx.appcompat:appcompat:1.1.0-rc01'
I helped jetifier
jetifier is added as dependency:
info Running jetifier to migrate libraries to AndroidX. You can disable it using "--no-jetifier" flag.
Jetifier found 1892 file(s) to forward-jetify. Using 4 workers...
info JS server already running.
info Installing the app...
Version:
"jetifier": "^1.6.3",
I see the #92. Thank you @oakis , I will give it a try
Guys, if you're using RN0.60, remove all manual setup for android. This library will work out of the box.
Jetifier solved mine. RN 0.59
npm install --save-dev jetifier or yarn add jetifier
In _gradle.properties add_,
android.useAndroidX=true
android.enableJetifier=true
npx jetify
react-native run-android
I resolved by adding googlePlayServicesVersion to android build.gradle
ext { buildToolsVersion = "28.0.2" minSdkVersion = 16 compileSdkVersion = 28 targetSdkVersion = 26 supportLibVersion = "27.1.1" googlePlayServicesVersion = "16.0.0" }
Most helpful comment
You probably did not update android folder, support library version should be 28 I think. This is the RN 0.59 config
Example project is updated with RN 0.59. Closing this, feel free to reopen if problem persists.