Androidx Fix RN 0.60, Jetifier Compliance
See original GitHub issueIn order to support React Native 0.60, library maintainers need to upgrade their android files to support androidx. This change can make a library unusable for users who have not upgraded their own app for androidx. The consensus solution for this issue is to update the build.gradle so that a library like jetifier can replace the non-compliant code.
For this app to be jetifier compliant, the following code in build.gradle needs to change from
compileOnly('com.facebook.react:react-native:+')
to
implementation('com.facebook.react:react-native:+') {
exclude group: 'com.android.support'
}
Afterwards, all users need to do is run npx jetify to update the code before running react-native run-android
The link below is an example of a successful PR implementing the above.
https://github.com/react-native-community/react-native-maps/commit/62bb953c19e55adb29200ecff9981eb5e594a7b3?diff=unified
@Agontuk could you please add these changes to your next commit? I am unable to submit a PR to address this issue myself.
Issue Analytics
- State:
- Created 4 years ago
- Reactions:20
- Comments:6 (3 by maintainers)
Top GitHub Comments
I’ve pushed a fix for RN60 in a separate branch https://github.com/Agontuk/react-native-geolocation-service/tree/rn60-fix. Can you try and see if it works ?
Same issue arises to me when I upgrade my react-native version. This issue is arising due to react-native update for support of AndroidX
Go to
~/node_modules/react-native-geolocation-service/android/build.gradle
and do the changes on
dependencies { ... compileOnly "com.facebook.react:react-native:+" }
to
dependencies { ... implementation('com.facebook.react:react-native:+') }