首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >安装响应导航和手势处理程序后获得错误gradlew.bat installDebug

安装响应导航和手势处理程序后获得错误gradlew.bat installDebug
EN

Stack Overflow用户
提问于 2019-02-03 16:02:46
回答 2查看 13.9K关注 0票数 3

我使用命令react本机init appName创建了新的new本机应用程序。在该应用程序创建成功安装在我的设备上使用命令的反应-本机运行-android,它成功地安装,并工作良好.无问题

但是一旦我安装了react导航和手势处理程序,我就得到了命令失败的错误:运行命令后的gradlew.bat installDebug -本机运行-android我不知道出了什么问题.我以前的反应--本土项目--运作得非常好。

我记得昨天我在我的一个旧项目中运行命令梯度。这对我的新项目有影响吗?

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

这是完全错误

代码语言:javascript
运行
复制
  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)
EN

回答 2

Stack Overflow用户

回答已采纳

发布于 2019-02-03 16:29:36

哦,是的,我认为RN0.58链接命令是个bug

使用来自settings.gradle‘D:\ from本机Apps\Practice\newapp\android\settings.gradle’的文本编辑器打开=>

将所有的'\‘替换为'/’,在我的例子中,我不得不将'..\node_modules\react-native-gesture-handler\android‘替换为'../node_modules/react-native-gesture-handler/android’

然后反应-本机运行-android

票数 17
EN

Stack Overflow用户

发布于 2019-02-06 04:19:06

确保您已经安装了python 2和jdk的最后一个版本,并确保您已经设置了ANDROID_HOME,并且应该遵循以下结构:https://facebook.github.io/react-native/docs/getting-started.html

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/54504742

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档