[英]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.我一直在尝试从 Android Studio 在我的 Android Emulator 中运行默认的 React Native App。
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).昨天我收到消息说找不到 Android sdk,所以我在我的 android 文件夹中创建了 local.properties 文件 (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.我试过cd android
-> gradlew clean
但遇到了同样的问题。
I also tried npm install --save-dev jetifier
-> npx jetify
-> npx react-native run-android
but got the same Problem.我也试过npm install --save-dev jetifier
-> npx jetify
npm install --save-dev jetifier
-> npx jetify
npx react-native run-android
但遇到了同样的问题。
I googled for about 4 hours but cant find anything the solves my problem.我用谷歌搜索了大约 4 个小时,但找不到任何解决我问题的方法。
Im pretty new to react and react native but thanks in advance for your help.我对本机反应和反应很陌生,但提前感谢您的帮助。
Use \\\\ instead of \\ in your pathvariable in local.properties在 local.properties 中的路径变量中使用 \\\\ 而不是 \\
So this:所以这:
"sdk.dir = C:\\Users"MyUserName"\\AppData\\Local\\Android\\Sdk"
becomes this:变成这样:
"sdk.dir = C:\\\\\\Users"MyUserName"\\\\\\AppData\\\\\\Local\\\\\\Android\\\\\\Sdk"
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.