gpt4 book ai didi

react-native - 构建React Native项目时出现错误

转载 作者:行者123 更新时间:2023-12-04 13:56:26 25 4
gpt4 key购买 nike

我收到以下错误

失败:生成失败,发生异常。

* Where:
Settings file 'G:\ReactNative\Contacts\android\settings.gradle' line: 3

* What went wrong:
Could not compile settings file 'G:\ReactNative\Contacts\android\settings.gradle'.
> startup failed:
settings file 'G:\ReactNative\Contacts\android\settings.gradle': 3: unexpected char: '\' @ line 3, column 133.
s\react-native-gesture-handler\android')

settings.gradle
rootProject.name = 'Contacts'
include ':react-native-gesture-handler'
project(':react-native-gesture-handler').projectDir = new File(rootProject.projectDir, '..\node_modules\react-native-gesture-handler\android')
include ':react-native-vector-icons'
project(':react-native-vector-icons').projectDir = new File(rootProject.projectDir, '..\node_modules\react-native-vector-icons\android')

include ':app'

这个文件实际上有什么问题?

最佳答案

尝试正斜杠/而不是反斜杠\

使用代码

rootProject.name = 'Contacts'
include ':react-native-gesture-handler'
project(':react-native-gesture-handler').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-gesture-handler/android')
include ':react-native-vector-icons'
project(':react-native-vector-icons').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-vector-icons/android')

include ':app'

而不是
rootProject.name = 'Contacts'
include ':react-native-gesture-handler'
project(':react-native-gesture-handler').projectDir = new File(rootProject.projectDir, '..\node_modules\react-native-gesture-handler\android')
include ':react-native-vector-icons'
project(':react-native-vector-icons').projectDir = new File(rootProject.projectDir, '..\node_modules\react-native-vector-icons\android')

include ':app'

希望对你有帮助

关于react-native - 构建React Native项目时出现错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54476682/

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