gpt4 book ai didi

react-native - 安装 react 导航和手势处理程序后出现错误 gradlew.bat installDebug

转载 作者:行者123 更新时间:2023-12-01 07:09:15 28 4
gpt4 key购买 nike

我使用命令 react-native init appName 创建了新的 React Native 应用程序。
在应用程序创建成功后,使用命令 react-native run-android 在我的设备中安装它,它安装成功,并且工作正常......没问题

但是一旦我安装了 react 导航和手势处理程序,我就会收到 的错误消息命令失败:gradlew.bat installDebug 运行命令 react-native run-android 后
我不知道出了什么问题……我的旧 React Native 项目运行良好。

我记得昨天我在我的一个旧项目中运行了命令 gradlew clean ..这对我的新项目有影响吗?

如果有人帮忙,我会很感激

这是完全错误

  FAILURE: Build failed with an exception.

* Where:
Settings file 'D:\React Native Apps\Practice\newapp\android\settings.gradle' line: 3

* What went wrong:
Could not compile settings file 'D:\React Native Apps\Practice\newapp\android\settings.gradle'.
> startup failed:
settings file 'D:\React Native Apps\Practice\newapp\android\settings.gradle': 3: unexpected char: '\' @ line 3, column 133.
s\react-native-gesture-handler\android')
^

1 error


* 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 1s
Could not install the app on the device, read the error above for details.
Make sure you have an Android emulator running or a device connected and have
set up your Android development environment:
https://facebook.github.io/react-native/docs/getting-started.html

Command failed: gradlew.bat installDebug

Error: Command failed: gradlew.bat installDebug
at checkExecSyncError (child_process.js:616:11)
at Object.execFileSync (child_process.js:634:13)
at runOnAllDevices (D:\React Native Apps\Practice\newapp\node_modules\react-native\local-cli\runAndroid\runAndroid.js:299:19)
at buildAndRun (D:\React Native Apps\Practice\newapp\node_modules\react-native\local-cli\runAndroid\runAndroid.js:135:12)
at isPackagerRunning.then.result (D:\React Native Apps\Practice\newapp\node_modules\react-native\local-cli\runAndroid\runAndroid.js:65:12)
at process._tickCallback (internal/process/next_tick.js:68:7)

最佳答案

哦,是的,我认为这是 RN 0.58 链接命令的错误

使用文本编辑器从 => 'D:\React Native Apps\Practice\newapp\android\settings.gradle' 打开 settings.gradle

用 '/' 替换所有 '\' ,在我的情况下,我不得不用 '../node_modules/react-native-gesture-handler/android' 替换 '..\node_modules\react-native-gesture-handler\android'

然后 react-native run-android

关于react-native - 安装 react 导航和手势处理程序后出现错误 gradlew.bat installDebug,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54504742/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com