我刚刚开始构建我的第一个React Native应用程序,但只取得了很小的成功。我已经构建了我的样板代码,但现在我想给它添加一个单独的屏幕。提示React导航。
我已经尝试了两次安装这个模块,但我没有太多的运气。我同时使用了React导航中的Facebook's documentation和Getting Started指南。还是不走运。
我得到的错误是与我的android文件夹中的build.gradle文件有关。根据入门指南,我确实在我的依赖项区域添加了两行代码,但这似乎没有任何效果。
错误消息如下:
Could not compile build file:
'C:\Users\USERNAME\Documents\ReactNative\WasteAway\android\app\build.gradle\'
> startup failed
General error during semantic analysis: Unsupported class file major version 57我在build.gradle文件中的依赖项如下:
dependencies {
implementation fileTree(dir: "libs", include: ["*.jar"])
implementation "com.facebook.react:react-native:+" // From node_modules
implementation 'androidx.appcompat:appcompat:1.1.0-rc01'
implementation 'androidx.swiperefreshlayout:swiperefreshlayout:1.1.0-alpha02'
if (enableHermes) {
def hermesPath = "../../node_modules/hermes-engine/android/";
debugImplementation files(hermesPath + "hermes-debug.aar")
releaseImplementation files(hermesPath + "hermes-release.aar")
} else {
implementation jscFlavor
}
}我是不是遗漏了一些明显的东西,或者我跳过了教程中的一个步骤?我看不出我哪里错了,伙计们。任何帮助都是非常感谢的。
发布于 2020-04-25 00:43:34
回答这个问题,因为我已经得到了解决方案的建议:看起来是我正在使用的JDK版本导致了问题。奇怪的是,我使用的是一个臭名昭著的buggy太新的版本。卸载和恢复JDK1.8解决了我的问题。解释here。
https://stackoverflow.com/questions/60513198
复制相似问题