我是React-Native的新手,并尝试使用Android Studio中的Android Antial构建Android应用程序。安装React-Navigation后,请按照React-Navigation文档中的所有步骤进行操作,我运行react-native run-android
,并且在命令行中获得此错误:
PS C:UserscompDesktopworkreactnativedansapp> react-native run-android
Starting JS server...
Building and installing the app on the device (cd android && gradlew.bat installDebug)...
FAILURE: Build failed with an exception.
* Where:
Settings file 'C:UserscompDesktopworkreactnativedansappandroidsettings.gradle' line: 3
* What went wrong:
Could not compile settings file 'C:UserscompDesktopworkreactnativedansappandroidsettings.gradle'.
> startup failed:
settings file 'C:UserscompDesktopworkreactnativedansappandroidsettings.gradle': 3: unexpected char:
'' @ line 3, column 133.
sreact-native-gesture-handlerandroid')
^
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:602:13)
at Object.execFileSync (child_process.js:622:13)
at runOnAllDevices (C:UserscompDesktopworkreactnativedansappnode_modulesreact-nativelocal-clirunAndroidrunAndroid.js:299:19)
at buildAndRun (C:UserscompDesktopworkreactnativedansappnode_modulesreact-nativelocal-clirunAndroidrunAndroid.js:135:12)
at isPackagerRunning.then.result (C:UserscompDesktopworkreactnativedansappnode_modulesreact-nativelocal-clirunAndroidrunAndroid.js:65:12)
at <anonymous>
at process._tickCallback (internal/process/next_tick.js:189:7)
PS C:UserscompDesktopworkreactnativedansapp>
有人知道这个错误是什么以及如何解决吗?在我安装react-nvigation之后,它似乎发生了以下步骤:https://reactnavigation.org/docs/en/getting-started.html
我已经输入了这些步骤,包括更改mainActivity.java
文件。我也不知道Gradle是什么。
任何帮助将不胜感激!
已知 easudy (请参阅Android和Windows中的React-netative链接的错误),希望很快就会修复。
跳入您的设置。
project(':react-native-gesture-handler').projectDir = new File(rootProject.projectDir, '..node_modulesreact-native-gesture-handlerandroid')
... with ...
project(':react-native-gesture-handler').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-gesture-handler/android')