Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Error Failed to install the app. Make sure you have the Android development environment set up

Tags:

react-native

I created the react-native project, then open the folder, at the terminal; After running "npm start" and then "react-native run-android" I was able to run it on the virtual device. However, when I do this from the vscode terminal, I get the following error;

info Running jetifier to migrate libraries to AndroidX. You can disable it using "--no-jetifier" flag. Jetifier found 863 file(s) to forward-jetify. Using 4 workers... info JS server already running. info Installing the app... Error: Could not find or load main class org.gradle.wrapper.GradleWrapperMain Caused by: java.lang.ClassNotFoundException: org.gradle.wrapper.GradleWrapperMain

error Failed to install the app. Make sure you have the Android development environment set up: https://facebook.github.io/react-native/docs/getting-started.html#android-development-environment. Run CLI with --verbose flag for more details. Error: Command failed: ./gradlew app:installDebug -PreactNativeDevServerPort=8081 Error: Could not find or load main class org.gradle.wrapper.GradleWrapperMain Caused by: java.lang.ClassNotFoundException: org.gradle.wrapper.GradleWrapperMain

at checkExecSyncError (child_process.js:601:13)
at execFileSync (child_process.js:621:13)
at runOnAllDevices (/home/myworldsoftware-u/İndirilenler/project2/node_modules/@react-native-community/cli-platform-android/build/commands/runAndroid/runOnAllDevices.js:74:39)
at buildAndRun (/home/myworldsoftware-u/İndirilenler/project2/node_modules/@react-native-community/cli-platform-android/build/commands/runAndroid/index.js:158:41)
at then.result (/home/myworldsoftware-u/İndirilenler/project2/node_modules/@react-native-community/cli-platform-android/build/commands/runAndroid/index.js:125:12)
at <anonymous>
at process._tickCallback (internal/process/next_tick.js:188:7)
like image 222
Mehmet Ceylan Avatar asked Jan 23 '26 07:01

Mehmet Ceylan


1 Answers

npx react-native doctor

This command checks your environment and displays a report of the status of react-native installation. Check the output carefully for other software you might need to install

like image 111
Keshav Gangwal Avatar answered Jan 27 '26 02:01

Keshav Gangwal



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!