【发布时间】:2022-01-07 08:14:10
【问题描述】:
这是我的settings.gradle 文件
rootProject.name = 'myappname'
apply from: new File(["node", "--print", "require.resolve('expo/package.json')"].execute(null, rootDir).text.trim(), "../scripts/autolinking.gradle");
useExpoModules()
apply from: new File(["node", "--print", "require.resolve('@react-native-community/cli-platform-android/package.json')"].execute(null, rootDir).text.trim(), "../native_modules.gradle");
applyNativeModulesSettingsGradle(settings)
include ':app'
运行./gradlew clean 或./gradlew bundleRelease 时出现此错误:
FAILURE: Build failed with an exception.
* Where:
Settings file '/Users/username/Desktop/myappname/android/settings.gradle' line: 2
* What went wrong:
A problem occurred evaluating settings 'myappname'.
> String index out of range: 0
* 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
知道如何解决这个问题吗?
【问题讨论】:
-
这只是告诉构建失败并出现异常。那个例外是什么?可以运行 ./gradlew bundleRelease --info 或 --debug 选项来获取有关错误的更多信息。
标签: android react-native gradle