React native: Android project not found. Maybe run react-native android first?

前端 未结 30 1178
孤街浪徒
孤街浪徒 2020-12-12 16:43

I had an issue in my React-Native project which was working fine earlier but suddenly it stopped working. Whenever I used the command:

react-native run-andro         


        
相关标签:
30条回答
  • 2020-12-12 17:35

    I did like this... Worked !!

    1. In the CMD Project root run react-native upgrade.
    2. if you are still getting issues, make sure you have react-native in dependencies json in package.json, add it if not
    3. if you are still getting issues, get the version of react native in cmd using react-native -v and check if the value returned in cmd and package.json are same. update the package.json with the value returned in cmd

    Here my problem solved.

    0 讨论(0)
  • 2020-12-12 17:35

    In my case i didn't had the right permissions for my project folder.

    If this is your case just click with the right button on the folder > Properties > Security > Advanced and then change the ownership of the folder to your user, including the subfolders. That should do it

    0 讨论(0)
  • 2020-12-12 17:36

    Open your React Native Project Root Directory and locate android -> app -> build -> intermediates -> signing_config -> debug -> out -> signing-config.json

    Delete the file and try again.

    0 讨论(0)
  • 2020-12-12 17:37

    I had to restyle my AndroidManifest.xml because I had a syntax error somewhere (I had an extra "/" somewhere). Now it's fixed. Be very careful with your syntax...

    0 讨论(0)
  • 2020-12-12 17:38

    I raised this question and answered myself as I thought it will help others who are facing similar issue. I struggled a lot to find out the real reason behind it as the error shown in terminal was not precise.

    To resolve the issue please upgrade the react-native package.

    1. Go to the Project root.

    2. Upgrade the React native package in the Command Prompt by typing :

      react-native upgrade.

    3. Then Accept to update all the Files by typing y (Yes) in the Command Prompt.

    Reference: https://github.com/facebook/react-native/issues/9312

    0 讨论(0)
  • 2020-12-12 17:39

    You should consider using the new upgrade tool based on Git. It makes upgrades easier by resolving most conflicts automatically. To use it: - Go back to the old version of React Native - Run "npm install -g react-native-git-upgrade" - Run "react-native-git-upgrade" See https://facebook.github.io/react-native/docs/upgrading.html

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