React-native-code-push: java.lang.IllegalStateException: Native module CodePush tried to override CodePushNativeModule. Check the getPackages() method in MainApplication.java, it might be that module is being created twice. If this was your intention, set canOverrideExistingModule=true

Created on 23 Aug 2019  路  6Comments  路  Source: microsoft/react-native-code-push

Not able to launch the app on on both modes (release and debug).It is giving me the error. I did not find any duplicates to check .

Most helpful comment

Either create or add this to your react-native.config.js

module.exports = {
  dependencies: {
    "react-native-code-push": {
      platforms: {
        android: null
      }
    }
  }
};

All 6 comments

Either create or add this to your react-native.config.js

module.exports = {
  dependencies: {
    "react-native-code-push": {
      platforms: {
        android: null
      }
    }
  }
};

Either create or add this to your react-native.config.js

module.exports = {
  dependencies: {
    "react-native-code-push": {
      platforms: {
        android: null
      }
    }
  }
};

not work

Either create or add this to your react-native.config.js

module.exports = {
  dependencies: {
    "react-native-code-push": {
      platforms: {
        android: null
      }
    }
  }
};

Worked for me
Thanks :)

What does this snippet do? A link to documentation etc would be helpful. Will codepush continue to work when this gets added?

@rockneverdies55 This simply disables autolinking native modules for the configured native libraries.

Ref: https://github.com/react-native-community/cli/blob/master/docs/autolinking.md#how-can-i-disable-autolinking-for-unsupported-library

Hi @trinadhkoya9 ,
Thanks for reporting!

Could you please update your react-native-code-push version to the latest and do steps from this docs: https://github.com/microsoft/react-native-code-push/blob/master/docs/setup-android.md#plugin-installation-and-configuration-for-react-native-060-version-and-above-android
This should fix your issue.

I'm going to close this issue for now. Please feel free to reopen it if you have any questions.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

kevando picture kevando  路  4Comments

Phredward picture Phredward  路  3Comments

ninjz picture ninjz  路  4Comments

cgerikj picture cgerikj  路  3Comments

vira-khdr picture vira-khdr  路  3Comments