radarlabs / react-native-radar

React Native module for Radar, the leading geofencing and location tracking platform
https://radar.com
Apache License 2.0
170 stars 32 forks source link

Version 2.1.11 of Android SDK Introduces Breaking AndroidX Change #96

Closed CuriousMark closed 4 years ago

CuriousMark commented 4 years ago

Describe the bug Android SDK version 2.1.11 starts to use AndroidX, which is a breaking change for apps running react-native v0.59.

Perhaps a 2.1.12 SDK should be released that uses old Android support library, or a hotfix version of the RN library which locks down the SDK version number: https://github.com/radarlabs/react-native-radar/blob/master/android/build.gradle#L47

To Reproduce

  1. Have an app running react-native v0.59 and RN Radar 2.1.9
  2. Attempt to build app
  3. Observe that build fails due to AndroidX collisions:
    > Task :app:processReleaseManifest FAILED
    /[APP]/android/app/src/main/AndroidManifest.xml:10:5-79 Warning:
    Element uses-permission#android.permission.ACCESS_NETWORK_STATE at AndroidManifest.xml:10:5-79 duplicated with element declared at AndroidManifest.xml:6:4-77
    /[APP]/android/app/src/main/AndroidManifest.xml:22:18-91 Error:
    Attribute application@appComponentFactory value=(android.support.v4.app.CoreComponentFactory) from [com.android.support:support-compat:28.0.0] AndroidManifest.xml:22:18-91
    is also present at [androidx.core:core:1.1.0] AndroidManifest.xml:24:18-86 value=(androidx.core.app.CoreComponentFactory).
    Suggestion: add 'tools:replace="android:appComponentFactory"' to <application> element at AndroidManifest.xml:17:5-103:17 to override.

Expected behavior App's behavior should not change due to hotfix version bump.

Gradle Output

2.1.10:

releaseCompileClasspath - Resolved configuration for compilation for variant: release
+--- io.radar:sdk:2.1.10
|    +--- com.android.support:support-annotations:28.0.0
|    +--- com.android.support:support-v4:28.0.0
|    |    +--- com.android.support:support-compat:28.0.0

2.1.11:

releaseCompileClasspath - Resolved configuration for compilation for variant: release
+--- io.radar:sdk:2.1.+ -> 2.1.11
|    +--- androidx.appcompat:appcompat:1.1.0
|    |    +--- androidx.annotation:annotation:1.1.0
|    |    +--- androidx.core:core:1.1.0

Metadata (please complete the following information):

nickpatrick commented 4 years ago

@CuriousMark Thanks for the heads up. We're about to release a React Native module for 0.60+, but can pin the version in the meantime. Which RN version are you on?

Stay tuned.

nickpatrick commented 4 years ago

@CuriousMark This should be fixed in version 2.1.10. Let me know!

CuriousMark commented 4 years ago

Thanks!

We were able to temp fix this using this build.gradle config:

configurations.all {
      resolutionStrategy.force 'io.radar:sdk:2.1.10

We'll update the RN Radar library version to avoid this more hacky solution. Thanks again for fix!