Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v1.3.0 doesn't work with jetify -r #411

Closed
geraintwhite opened this issue Oct 1, 2019 · 10 comments
Closed

v1.3.0 doesn't work with jetify -r #411

geraintwhite opened this issue Oct 1, 2019 · 10 comments
Labels
Platform: Android This issue is specific to Android

Comments

@geraintwhite
Copy link

I have updated to v1.3.0 and I am getting Android build errors with react-native 0.59.10.

package android.support.transition does not exist

I am using jetify -r in my postinstall because I cannot enable AndroidX yet.

@SaeedZhiany
Copy link

It's because the latest Gradle file is not backward compatible with support libraries.
jetify -r just converts androidx to support in java files not the Gradle file.
for more information, you can take a look at a similar issue in react-native-inappbrowser that has been solved by its maintainer

cc @kmagiera

@SaeedZhiany
Copy link

@grit96
you have two options:

  1. modify this line in the library's Gradle file manually and convert it back to use support library.

  2. use a previous version of this library that doesn't migrate the Gradle file to androidx.

@kmagiera it worth if you add backward compatibility for support library just like the way @jdnichollsc has done in this PR

@timothystewart6
Copy link

timothystewart6 commented Oct 7, 2019

Not sure if there is a 3rd option but I have been using jetifier as a devDependency along with

    "postinstall": "npx jetify",

and this has been working for me. When switching to jetify -r it breaks.

All I had to do was:

yarn add --dev jetifier

update package.json

    "postinstall": "npx jetify",

react-native run-android

Hope this helps! 😄

** edit**
Thanks @SaeedZhiany for pointing that out, this will only work on RN +0.60. Sorry!

@SaeedZhiany
Copy link

@timothystewart6
using jetify without the -r option migrate supportLib usages to androidx in java files and this is good only for those using RN +60, but @grit96 said that he is using RN 0.59.10 so your suggestion does not seem to be correct.

@chj-damon
Copy link
Contributor

@grit96
you have two options:

  1. modify this line in the library's Gradle file manually and convert it back to use support library.
  2. use a previous version of this library that doesn't migrate the Gradle file to androidx.

@kmagiera it worth if you add backward compatibility for support library just like the way @jdnichollsc has done in this PR

any idea which version that doesn't migrate the Gradle file to androidx? I encountered the same problem. same react-native version 0.59.10

@timothystewart6
Copy link

timothystewart6 commented Oct 9, 2019

@chj-damon judging only by the release notes it looks like androidx migration was introduced on 1.3.0 so 1.2.0.

@chj-damon
Copy link
Contributor

@timothystewart6 Thanks!

@jdnichollsc
Copy link

If you want to avoid breaking changes from this library, you can add backward compatibility (maintainer) => https://twitter.com/jdnichollsc/status/1162451046544879616

@hello-jun
Copy link

hello-jun commented Oct 17, 2019

I have updated to v1.3.0 and I am getting Android build errors with react-native 0.59.10.

package android.support.transition does not exist

I am using jetify -r in my postinstall because I cannot enable AndroidX yet.

Open the file android/gradle.properties,and add the code below,you can fix the issue

android.enableJetifier=true
android.useAndroidX=true

@jakub-gonet jakub-gonet added the Platform: Android This issue is specific to Android label Dec 31, 2019
@jakub-gonet
Copy link
Member

This issue is outdated right now, current React Native is 0.62 and we released reanimated v2 (changing build.gradle configs completely), so I'm closing it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Platform: Android This issue is specific to Android
Projects
None yet
Development

No branches or pull requests

7 participants