我增加了反应导航和反应本机手势处理程序。当我使用react-原生run-android运行该项目时,我会得到以下错误:
Could not compile settings file 'C:\Users\pc\Desktop\GSTCalc\android\settings.gradle'.
> startup failed:
settings file 'C:\Users\pc\Desktop\Project\android\settings.gradle': 3: unexpected char: '\' @ line 3, column 133.Following is the content of my settings.gradle file:
rootProject.name = 'GSTCalc'
include ':react-native-gesture-handler'
project(':react-native-gesture-handler').projectDir = new File(rootProject.projectDir, '..\node_modules\react-native-gesture-handler\android')
include ':app'
我尝试从我的项目文件夹中删除节点模块文件夹。并运行npm安装。但都徒劳无功。我还能做什么?提前谢谢。
发布于 2019-01-26 14:35:18
我也有同样的问题。
我的第一行(有错误的那一行)是:
project(':react-native-gesture-handler').projectDir = new File(rootProject.projectDir, '..\node_modules\react-native-gesture-handler\android')我把它改成:
project(':react-native-gesture-handler').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-gesture-handler/android')我重建了它,它起作用了!希望这能有所帮助。
发布于 2019-02-05 15:51:28
它的工作方式是添加以下内容:
project(':react-native-gesture-handler').projectDir = new
File(rootProject.projectDir, '../node_modules/react-native-gesture-handler/android')发布于 2022-11-23 06:37:24
在build.gradle文件中添加kotlin版本。
buildscript {
ext {
...
kotlinVersion = "1.5.20"
...
}
}https://stackoverflow.com/questions/54377566
复制相似问题