React-native-branch-deep-linking-attribution: AndroidX Support (RN 0.60)

Created on 27 May 2019  路  7Comments  路  Source: BranchMetrics/react-native-branch-deep-linking-attribution

Starting with RN 0.60, AndroidX will be enabled:

android.useAndroidX=true
android.enableJetifier=true

https://github.com/facebook/react-native/blob/v0.60.0-rc.0/template/android/gradle.properties

This will lead to a series of compile errors with this repository as it still uses the old support library:

node_modules/react-native-branch/android/src/main/java/io/branch/rnbranch/RNBranchModule.java:9: error: package android.support.annotation does not exist
import android.support.annotation.Nullable;
                                 ^
node_modules/react-native-branch/android/src/main/java/io/branch/rnbranch/RNBranchModule.java:10: error: package android.support.v4.content does not exist
import android.support.v4.content.LocalBroadcastManager;
                                 ^
node_modules/react-native-branch/android/src/main/java/io/branch/rnbranch/RNBranchModule.java:597: error: cannot find symbol
    public static LinkProperties createLinkProperties(ReadableMap linkPropertiesMap, @Nullable ReadableMap controlParams){
                                                                                      ^
  symbol:   class Nullable
  location: class RNBranchModule
node_modules/react-native-branch/android/src/main/java/io/branch/rnbranch/RNBranchModule.java:851: error: cannot find symbol
    @Nullable
     ^
  symbol:   class Nullable
  location: class RNBranchModule
node_modules/react-native-branch/android/src/main/java/io/branch/rnbranch/RNBranchModule.java:965: error: cannot find symbol
    public void sendRNEvent(String eventName, @Nullable WritableMap params) {
                                               ^
  symbol:   class Nullable
  location: class RNBranchModule
node_modules/react-native-branch/android/src/main/java/io/branch/rnbranch/RNBranchModule.java:188: error: cannot find symbol
                LocalBroadcastManager.getInstance(mmActivity).sendBroadcast(broadcastIntent);
                ^
  symbol: variable LocalBroadcastManager
node_modules/react-native-branch/android/src/main/java/io/branch/rnbranch/RNBranchModule.java:284: error: cannot find symbol
        LocalBroadcastManager.getInstance(reactContext).registerReceiver(mInitSessionEventReceiver, new IntentFilter(NATIVE_INIT_SESSION_FINISHED_EVENT));
        ^
  symbol:   variable LocalBroadcastManager
  location: class RNBranchModule
node_modules/react-native-branch/android/src/main/java/io/branch/rnbranch/RNBranchModule.java:289: error: cannot find symbol
        LocalBroadcastManager.getInstance(getReactApplicationContext()).unregisterReceiver(mInitSessionEventReceiver);
        ^
  symbol:   variable LocalBroadcastManager
  location: class RNBranchModule

Most helpful comment

@brunobar79 @JoaquinBeceiro @danilobuerger Hi guys! We fixed the problem: https://github.com/BranchMetrics/react-native-branch-deep-linking-attribution/pull/464
While we are waiting for merge PR you can use the library like it (_package.json_):

"react-native-branch": "git://github.com/startmatter/react-native-branch-deep-linking-attribution.git#fix\/migrate_to_androidX"

All 7 comments

Thanks for the heads up. We'll have to test and release a patch.

@jdee Any ETA for that patch?

@danilobuerger do you have any workaround to fix that for now?

@brunobar79 @JoaquinBeceiro @danilobuerger Hi guys! We fixed the problem: https://github.com/BranchMetrics/react-native-branch-deep-linking-attribution/pull/464
While we are waiting for merge PR you can use the library like it (_package.json_):

"react-native-branch": "git://github.com/startmatter/react-native-branch-deep-linking-attribution.git#fix\/migrate_to_androidX"

@jdee 0.60 has been released. It would be awesome if you could review the PR made by @maximzah .

The PR seems straightforward enough, is there a reason for the delay?

Was this page helpful?
0 / 5 - 0 ratings