安装反应导航和手势处理程序后出现错误gradlew.bat installDebug [英] getting error gradlew.bat installDebug after installing react navigation and gesture handler
问题描述
我使用命令react-native init appName创建新的react native应用程序. 应用程序创建成功后,使用命令react-native run-android将其安装到我的设备中,安装成功,并且运行正常...没问题
I create the new react native app using command react-native init appName. After the app created successfully install it in my device using command react-native run-android, it installed successfully, and works fine... no issue
但是当我安装react导航和手势处理程序后,我得到的错误是命令失败:运行命令react-native run-android后gradlew.bat installDebug 我不知道这是怎么回事...我的旧React Native项目运行得很好.
but as soon I install react navigation and gesture handler I am getting the error that Command failed: gradlew.bat installDebug after running command react-native run-android I don't know what's wrong... my old react native projects are working perfectly fine.
我记得昨天我在一个旧项目中运行了gradlew clean命令..这对我的新项目有影响吗?
I remember yesterday I run the command gradlew clean in one of my old project.. is this effecting on my new project?
如果有人帮忙我会很感激
I would be really thankful if someone helps
这是完全错误
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链接命令是一个错误
Oh yeah, it´s a bug i think with RN 0.58 link command
使用=>'D:\ React Native Apps \ Practice \ newapp \ android \ settings.gradle'中的文本编辑器打开settings.gradle
open settings.gradle with a text editor from => 'D:\React Native Apps\Practice\newapp\android\settings.gradle'
将所有'\'替换为'/',在我的情况下,我必须将'.. \ node_modules \ react-native-gesture-handler \ android'替换为'../node_modules/react-native-gesture-handler /android'
replace all '\' with '/' , in my case i had to replace '..\node_modules\react-native-gesture-handler\android' with '../node_modules/react-native-gesture-handler/android'
然后使用react-native run-android
then react-native run-android
这篇关于安装反应导航和手势处理程序后出现错误gradlew.bat installDebug的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!