How to rebuild the entire Android folder?

后端 未结 8 2131
长发绾君心
长发绾君心 2021-01-31 17:44

I have messed the files up in the Android folder and would like to rebuild the Android project inside of the Android folder. How do I do this?

Is it safe to delete the

相关标签:
8条回答
  • 2021-01-31 18:14

    Try to do this:

    cd android
    gradlew clean 
    cd ..
    react-native run-android
    
    0 讨论(0)
  • 2021-01-31 18:23

    I had similar problem, and ./gradlew clean didn't work, but i found hacky solution from How can I regenerate ios folder in React Native project?

    Delete android folder (probably ios too), and then hacky part ->:

    react-native upgrade 
    

    (it regenerates folders, but it shouldn't be used to upgrade RN..)

    And then

    react-native link
    react-native run-android
    

    It worked for me :)

    EDIT : one observation -> react-native sometimes goes crazy and cannot run some commands. Launching a new terminal helps. Bizarre :)

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