React原生应用(刚刚创建)在安装React -native-gesture handle等包时崩溃,并出现以下错误消



error安装应用程序失败。请确保您已设置Android开发环境:https://reactnative.dev/docs/environment-setup。gradlew.bat app:installDebug -PreactNativeDevServerPort=8081

failed: Build completed with 2 failed .

1: Task failed with an exception.

  • 地点:构建文件"E:React_nativepaperboynode_modulesreact-native-gesture-handlerandroid Build。Gradle ' line: 27

  • 哪里出错了:在评估项目':react-native-gesture-handler'时出现问题。

无法初始化类org.jetbrains.kotlin.gradle.plugin.sources.DefaultKotlinSourceSetKt

  • 试题:

使用——stacktrace选项运行以获取堆栈跟踪。使用——info或——debug选项运行以获得更多的日志输出。运行-scan以获得完整的见解。==============================================================================

2: Task failed with an exception.

  • 哪里出错了:配置项目':react-native-gesture-handler'时出现问题。

compileSdkVersion未指定。请添加到build.gradle

  • 试题:

使用——stacktrace选项运行以获取堆栈跟踪。使用——info或——debug选项运行以获得更多的日志输出。运行-scan以获得完整的见解。==============================================================================

  • 更多帮助请访问https://help.gradle.org

BUILD FAILED in 14s

at makeError (E:React_nativepaperboynode_modulesexecaindex.js:174:9)
at E:React_nativepaperboynode_modulesexecaindex.js:278:16
at processTicksAndRejections (node:internal/process/task_queues:96:5)
at async runOnAllDevices (E:React_nativepaperboynode_modules@react-native-communitycli-platform-androidbuildcommandsrunAndroidrunOnAllDevices.js:109:5)
at async Command.handleAction (E:React_nativepaperboynode_modules@react-native-communityclibuildindex.js:192:9)

info运行带有——verbose标志的命令行获取更多详细信息。

尝试在signingConfigs>下删除build.gradle文件中的if..else条件。release。例子:

signingConfigs {
debug {
storeFile file('debug.keystore')
storePassword 'android'
keyAlias 'androiddebugkey'
keyPassword 'android'
}
release {
storeFile file('xxx')
storePassword 'xxx'
keyAlias 'xxx'
keyPassword 'xxx'
}
}

相关内容

  • 没有找到相关文章

最新更新