我刚刚开始构建我的第一个React Native应用程序,但收效甚微。我已经建立了样板代码,但是现在我想为其添加一个单独的屏幕。提示反应导航。
尝试两次安装该模块,我运气不太好。我同时使用了React Navigation本身的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
}
}
我是否在这里遗漏了一些明显的内容,还是跳过了教程的步骤?伙计们,我看不到我要去哪里错了。任何帮助将不胜感激。