Collectives™ on Stack Overflow

Find centralized, trusted content and collaborate around the technologies you use most.

Learn more about Collectives

Teams

Q&A for work

Connect and share knowledge within a single location that is structured and easy to search.

Learn more about Teams

I did all the prerequisites for using react native on Windows and created the project by executing the npx react-native init myplatform command but I encountered the following error after the npx react-native run-android command and couldn't believe my eyes because some time ago it was running on the system without any problems.

react native version : 0.63.4

This is the common error that occurs sometimes, we can try to run the app from the android studio Jignesh Mayani Jan 27, 2021 at 5:21 Thank you! You know it worked but it doesn't work all the time, I don't know why. I started my new project using expo now Walmac Mar 2, 2021 at 9:51 True, that by just opening the app from the Android Studio IDE, and not even doing a build, but simply opening the project, and letting it do some syncing, indeed made the issue went away. daparic Nov 3, 2021 at 15:43

This error is because of your gradlew.bat file is corrupt try add new one then try again.

you can find new file from react native github

gradlew.bat

try this!

Thank you for your response, but your command is for native script while I use react native Ali Rezaie Jan 27, 2021 at 5:31 @AliRezaie sorry my bad, please make sure your device is connected with command "adb devices" & run this, "cd android && gradlew clean && gradlew cleanBuildCache && cd.." Kuldeep Patel Jan 27, 2021 at 5:44 When I ran gradlew clean in this project, I got a not recognized error. Then I created a new project with version 0.63.3 and the project ran without any problems Ali Rezaie Jan 27, 2021 at 8:11
  • miss gradlew shell script
  • miss debug.keystore (optional)
  • match downloaded SDK version, if NDK needed, do the same process
  • example build.gradle

            buildToolsVersion = "29.0.3"
            minSdkVersion = 21
            compileSdkVersion = 30
            targetSdkVersion = 30
            ndkVersion = "20.1.5948944"
            kotlin_version = "1.3.50"
            kotlinVersion = "$kotlin_version"
            androidXCore = "1.6.0"
            

    Thanks for contributing an answer to Stack Overflow!

    • Please be sure to answer the question. Provide details and share your research!

    But avoid

    • Asking for help, clarification, or responding to other answers.
    • Making statements based on opinion; back them up with references or personal experience.

    To learn more, see our tips on writing great answers.