我使用命令react本机init appName创建了新的new本机应用程序。在该应用程序创建成功安装在我的设备上使用命令的反应-本机运行-android,它成功地安装,并工作良好.无问题
但是一旦我安装了react导航和手势处理程序,我就得到了命令失败的错误:运行命令后的gradlew.bat installDebug -本机运行-android我不知道出了什么问题.我以前的反应--本土项目--运作得非常好。
我记得昨天我在我的一个旧项目中运行命令梯度。这对我的新项目有影响吗?
如果有人帮忙,我会很感激的
这是完全错误
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)
发布于 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
发布于 2019-02-06 04:19:06
确保您已经安装了python 2和jdk的最后一个版本,并确保您已经设置了ANDROID_HOME,并且应该遵循以下结构:https://facebook.github.io/react-native/docs/getting-started.html
https://stackoverflow.com/questions/54504742
复制相似问题