felixkoe
felixkoe

Reputation: 65

React Native: Could not determine the dependencies of task ':app:installDebug'

I`ve been trying to run the default React Native App in my Android Emulator from Android Studio.

Yesterday I got the message that the Android sdk cant be found so i created the local.properties file in my android folder with (sdk.dir = C:\Users"MyUserName"\AppData\Local\Android\Sdk).

That worked but now i get another problem:

FAILURE: Build failed with an exception.

* What went wrong:
Could not determine the dependencies of task ':app:installDebug'.
> java.io.IOException: Die Syntax fuer den Dateinamen, Verzeichnisnamen oder die 
Datentraegerbezeichnung ist falsch

* 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 11s

error Failed to install the app. Make sure you have the Android development environment set up: 
https://reactnative.dev/docs/environment-setup. Run CLI with --verbose flag for more details.
Error: Command failed: gradlew.bat app:installDebug -PreactNativeDevServerPort=8081

I tried cd android -> gradlew clean but got the same Problem.

I also tried npm install --save-dev jetifier-> npx jetify -> npx react-native run-android but got the same Problem.

I googled for about 4 hours but cant find anything the solves my problem.

Im pretty new to react and react native but thanks in advance for your help.

Upvotes: 0

Views: 7658

Answers (1)

Derk-B
Derk-B

Reputation: 101

Use \\ instead of \ in your pathvariable in local.properties

So this:

"sdk.dir = C:\Users"MyUserName"\AppData\Local\Android\Sdk"

becomes this:

"sdk.dir = C:\\Users"MyUserName"\\AppData\\Local\\Android\\Sdk"

Upvotes: 3

Related Questions