简体   繁体   中英

Unable to run react native app android emulator

I am trying to run a react-native project in VS code which is been imported from another system But I am getting the following error, as follows

error Failed to install the app. Make sure you have the Android development environment set up: https://reactnative.dev/docs/environment-setup.
Error: Command failed: ./gradlew app:installDebug -PreactNativeDevServerPort=8081
env: sh\r: No such file or directory

at makeError (/Users/Siva/Desktop/RN/Innoppl-Liberate/Mobile/node_modules/@react-native-community/cli-platform-android/node_modules/execa/index.js:174:9)
at /Users/Siva/Desktop/RN/Innoppl-Liberate/Mobile/node_modules/@react-native-community/cli-platform-android/node_modules/execa/index.js:278:16
at processTicksAndRejections (internal/process/task_queues.js:93:5)
at async runOnAllDevices (/Users/Siva/Desktop/RN/Innoppl-Liberate/Mobile/node_modules/@react-native-community/cli-platform-android/build/commands/runAndroid/runOnAllDevices.js:106:5)
at async Command.handleAction (/Users/Siva/Desktop/RN/Innoppl-Liberate/Mobile/node_modules/@react-native-community/cli/build/index.js:192:9)

info Run CLI with --verbose flag for more details.

When I run the react-native project created in my own device, it is running good and the app is launched in the emulator.

It seems the android environment setup is working good for projects created in my own device where as the imported files have error - how to fix this

Can you try this command at project root:

chmod 755 android/gradlew

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM