How to incorporate AndroidX support into my app?

2026-06-11 07:082阅读0评论SEO资源
  • 内容介绍
  • 文章标签
  • 相关推荐

本文共计349个文字,预计阅读时间需要2分钟。

How to incorporate AndroidX support into my app?

Android Q(目前处于Beta阶段)将仅支持AndroidX支持库。此外,React Native 0.60及以后版本将默认包含AndroidX支持。因此,请确保更新到这些版本。

FeatureRequestAndroidQ(currentlyinBeta)willonlysupportAndroidXsupp Feature Request

Android Q(currently in Beta) will only support AndroidX support libraries. Additionally React Native 0.60 will include default AndroidX support. As such, it would be helpful to have a new version with AndroidX support soon after RN 60 is released. We may want to do this as a major version bump in case we want to keep supporting the current version with minor fixes.

How to incorporate AndroidX support into my app?

Edit: Google Play Services latest version uses AndroidX as well

Why it is needed

Once AndroidX support lands in RN 60, there will be a need for all RN packages to add AndroidX support as you can only have one or the other and Jetifier doesn't work with 3rd party dependencies.

Possible implementation

Use Jetifier to migrate support lib to androidx if we're already on support lib version 28.0.0

Code sample

Migration Guide

该提问来源于开源项目:react-native-device-info/react-native-device-info

It does look that way.

1cd android && ./gradlew :app:dependencies

might show why it was still linking against the support libraries. My guess is the library name or version or similar?

In fact I think these library names: github.com/react-native-community/react-native-device-info/blob/master/android/build.gradle#L44 may need the treatment of replacing the entire library name as I mentioned myself in the jetifier docs.

If someone is willing to try a patch to the build.gradle here that implements that, it would likely fix it and be useful for others as a PR and/or as a patch to use via patch-package until we can do a release

本文共计349个文字,预计阅读时间需要2分钟。

How to incorporate AndroidX support into my app?

Android Q(目前处于Beta阶段)将仅支持AndroidX支持库。此外,React Native 0.60及以后版本将默认包含AndroidX支持。因此,请确保更新到这些版本。

FeatureRequestAndroidQ(currentlyinBeta)willonlysupportAndroidXsupp Feature Request

Android Q(currently in Beta) will only support AndroidX support libraries. Additionally React Native 0.60 will include default AndroidX support. As such, it would be helpful to have a new version with AndroidX support soon after RN 60 is released. We may want to do this as a major version bump in case we want to keep supporting the current version with minor fixes.

How to incorporate AndroidX support into my app?

Edit: Google Play Services latest version uses AndroidX as well

Why it is needed

Once AndroidX support lands in RN 60, there will be a need for all RN packages to add AndroidX support as you can only have one or the other and Jetifier doesn't work with 3rd party dependencies.

Possible implementation

Use Jetifier to migrate support lib to androidx if we're already on support lib version 28.0.0

Code sample

Migration Guide

该提问来源于开源项目:react-native-device-info/react-native-device-info

It does look that way.

1cd android && ./gradlew :app:dependencies

might show why it was still linking against the support libraries. My guess is the library name or version or similar?

In fact I think these library names: github.com/react-native-community/react-native-device-info/blob/master/android/build.gradle#L44 may need the treatment of replacing the entire library name as I mentioned myself in the jetifier docs.

If someone is willing to try a patch to the build.gradle here that implements that, it would likely fix it and be useful for others as a PR and/or as a patch to use via patch-package until we can do a release