question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Androidx Fix RN 0.60, Jetifier Compliance

See original GitHub issue

In 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:closed
  • Created 4 years ago
  • Reactions:20
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

3reactions
Agontukcommented, Jul 15, 2019

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 ?

2reactions
manu006commented, Jul 12, 2019

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:+') }

Read more comments on GitHub >

github_iconTop Results From Across the Web

Jetifier - Android Developers
0-beta06 and androidx.jetifier:jetifier-processor:1.0.0-beta06 are released. The commits included in this version can be found here. Bug fixes.
Read more >
Blog - React Native
AndroidX is a major step forward in the Android ecosystem, and the old support library artifacts are being deprecated. For 0.60, React Native ......
Read more >
React Native Upgrade Helper
React Native 0.60 includes Cocoapods integration by default, AndroidX support, ... specific version of RN, and it uses that knowledge to align dependencies, ......
Read more >
React Native 0.60 releases with accessibility improvements ...
Here are some of the accessibility updates to React Native 0.60: ... for this called “jetifier”, an AndroidX transition tool in npm format, ......
Read more >
info running jetifier to migrate libraries to androidx. you can ...
npm install --save-dev jetifier npx jetify npx react-native run-android. Call. npx jetify ... How to solve the following error in react native.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found