【发布时间】:2020-03-03 18:07:33
【问题描述】:
我刚刚开始构建我的第一个 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
}
}
我是否在这里遗漏了一些明显的东西,或者我跳过了教程中的一步?伙计们,我看不出我在哪里出错了。非常感谢任何帮助。
【问题讨论】:
-
请写完整的gradle日志
标签: javascript android react-native react-native-android react-navigation