Application main has not been registered

后端 未结 5 819
伪装坚强ぢ
伪装坚强ぢ 2021-01-11 12:04

I have recently started to convert my react native app and running on Expo so i could test this on my actual android device. I am getting this error above. I have since then

相关标签:
5条回答
  • 2021-01-11 12:11

    I created a Project from "Doco", and save it with Practice. so write that line like that

    AppRegistry.registerComponent('Practice', () => FixedDimensionsBasics);
    

    then I get an error like in a question

    So, I check on my Appdelegate.m file on ios folder and find that Project name is Project so I change that line with

    AppRegistry.registerComponent('Project', () => FixedDimensionsBasics);
    

    and my Error solved

    so if you are using "Doco" then check that thing.

    0 讨论(0)
  • 2021-01-11 12:15

    The following solution worked:

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

    Credits: Rishav Kumar

    (Cannot you people just reply to mark as solve ?)

    0 讨论(0)
  • 2021-01-11 12:16

    Removed node_modules and reinstalled by yarn that worked for me.

    0 讨论(0)
  • 2021-01-11 12:26

    The problem is you haven't opened your project in Android Studio. The previous project is running in android studio and you are running the latest one in emulator.

    0 讨论(0)
  • 2021-01-11 12:29

    I came across this issue because I had previously run a React project that was not fully shut down. To fix this, I could have restarted my computer. But I chose to do this instead: (Using MacOS, should work with Linux as well, for Windows you would likely need to use Task Manager or similar):

    1. Open terminal
    2. Find the program that is using port 8081 by typing "lsof -i :8081". (Note this is LSOF in lowercase)
    3. Look at the process ID (under the PID column)
    4. Kill the process by typing "kill -9 PID" (where PID is the process ID number you found in step 3).

    After killing the process you should be able to run your react-native project.

    0 讨论(0)
提交回复
热议问题