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

前端 未结 30 1174
孤街浪徒
孤街浪徒 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:20

    For me, "rm -rf android/app/build/" worked

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

    In my case, I've forgotten to add Sudo. Fixed as follows,

    sudo npx react-native run-android
    
    0 讨论(0)
  • 2020-12-12 17:21

    I think one more simple thing you could have checked, is if previously you ran the project as different role of a user, like in windows if you ran previously the react-native run-android with an administrator role.

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

    My working solution is below, none of the above worked for me:

    CD into your project folder and type expo start --android.

    Or the long way:

    1. Open AVD manager in Android Studio and run a virtual device (you can close AS afterwards)
    2. CMD into your project folder and type 'expo start'
    3. Once Expo has started choose option 2 which is "Press a for Android emulator"

    It will install expo on the virtual device and you can test from there

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

    I know it is an old question but any of those solutions did not work for me and maybe there are others like me. I solved my problem running this command before run-android

    react-native eject
    
    0 讨论(0)
  • 2020-12-12 17:22

    Remove the file: React Native Project Root Directory and locate android -> app -> build -> intermediates -> signing_config -> debug -> out -> signing-config.json .

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