简体   繁体   English

React Native:无法确定任务“:app:installDebug”的依赖关系

[英]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.

相关问题 React Native-任务':app:installDebug'的执行失败 - React Native - Execution failed for task ':app:installDebug' 反应本机任务:应用程序:安装调试失败 - React Native Task :app:installDebug FAILED 无法确定任务 ':react-native-onesignal:compileDebugAidl' 的依赖关系 - Could not determine the dependencies of task ':react-native-onesignal:compileDebugAidl' 如何修复错误说“任务:app:installDebug FAILED”,同时在android studio中运行我的反应本机项目? - How to fix error saying “Task :app:installDebug FAILED”, while run my react native project in android studio? 无法解析配置“:app:debugRuntimeClasspath”的所有任务依赖项 - Could not resolve all task dependencies for configuration ':app:debugRuntimeClasspath' 任务 ':app:checkDebugDuplicateClasses' 执行失败。 反应原生 - Execution failed for task ':app:checkDebugDuplicateClasses'. React Native React Native:任务 ':app:mergeAlphaDebugNativeLibs' 执行失败 - React Native : Execution failed for task ':app:mergeAlphaDebugNativeLibs' 任务':app:processDebugResources'的执行失败 - React Native - Execution failed for task ':app:processDebugResources' - React Native (React Native):任务 ':app:generatePackageList' 执行失败 - (React Native): Execution failed for task ':app:generatePackageList' 无法将Debugger与react-native应用程序连接? - Could not connect Debugger with react-native app?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM