Application is not Registered in react native

后端 未结 3 1657
轻奢々
轻奢々 2021-01-22 13:47

I have a react native application and I changed the package name of the application using https://www.npmjs.com/package/react-native-rename. After that I tried to run the projec

相关标签:
3条回答
  • 2021-01-22 14:21

    You need to check 2 files to make sure you have equal names there:

    1. index.js -> application name in the last line:

    AppRegistry.registerComponent('YourAppName', () => App);

    1. app.json -> name property

    In both places names should be equal (case sensitive).

    0 讨论(0)
  • 2021-01-22 14:22

    Have you changed the values ​​in the index.ios.js, index.android.js and app.json files?

    There are some instructions here.

    0 讨论(0)
  • 2021-01-22 14:33

    android\app\src\main\java\com{someFolderName}\MainActivity.java

    you landed up on this answer because still you are not able to solve the issue

    open the file mentioned in above in title
    this used for

    • Returns the name of the main component registered from JavaScript.
    • This is used to schedule rendering of the component.

    look for method

        @Override
        protected String getMainComponentName() {
            return "AddYourNewNameHere";
        }
    

    which might be returning a hard coded string replace it to desired name!!

    EXTENDED TIP

    ensure you clean your gradle demon as the project does not compile sometimes for that use following

    • cd android
    • gradlew clean
    0 讨论(0)
提交回复
热议问题