Skip to main content

Command Palette

Search for a command to run...

React Native First App v0.76.

Troubleshooting error encounter while app creation.

Published
2 min readView as Markdown
R

Looking for new opportunities in mobile app development and trying to enhance my skills in same field.

CASE 1: While creating your first react native app if you got an error or empty folder created, then this article will let you know how to resolve it.

Sometimes, While running your first init command to build application in react native it doesn’t create the app or will create an empty folder with project name. In such case, you need to run the below command to get your project build with all the dependent files or folder.

Solution:

npx @react-native-community/cli@latest init MyProject --version latest

you can replace MyProject with your project name in above command.

And your project will get created with all the dependent files and folders.

CASE 2: While project creation if you receive below error—

Error Failed to install the app. Command failed with exit code 1: gradlew.bat app:installDebug -PreactNativeDevServerPort=8081 FAILURE: Build failed with an exception. What went wrong: java.io.UncheckedIOException: Could not move temporary workspace (C:\Users\hp\Desktop\RashiApp1\android\.gradle\8.6\dependencies-accessors\423f0288fa7dffe069445ffa4b72952b4629a15a-bce99df7-ee7c-4b3b-bd9b-47f4b20ab8dc) to immutable location (C:\Users\hp\Desktop\RashiApp1\android\.gradle\8.6\dependencies-accessors\423f0288fa7dffe069445ffa4b72952b4629a15a) > Could not move temporary workspace (C:\Users\hp\Desktop\RashiApp1\android\.gradle\8.6\dependencies-accessors\423f0288fa7dffe069445ffa4b72952b4629a15a-bce99df7-ee7c-4b3b-bd9b-47f4b20ab8dc) to immutable location (C:\Users\hp\Desktop\RashiApp1\android\.gradle\8.6\dependencies-accessors\423f0288fa7dffe069445ffa4b72952b4629a15a) Try: > Run with --stacktrace option to get the stack trace. > Run with --info or --debug option to get more log output. > Run with --scan to get full insights. > Get more help at https://help.gradle.org. BUILD FAILED in 5s.

Solution:

If you got above error while running the app then it means gradle version that is being used by react native app is not compatible with android and java sdk and jdk.

So, Go to Project file-> android->gradle->gradle-wrapper.properties and change the gradle version to one previous that is mentioned in it. For ex- 8.6 to 8.5.

Save a change and run app again. The App will run successfully in your mobile device.

Thankyou! Stay Tuned….