将React Native连接到firebase给我错误

问题描述 投票:0回答:2

我正在尝试将我的react-native连接到firebase,但这给了我一个错误。该错误的可能解决方法是什么。当我发出命令react-native run-android时,出现此错误

info Running jetifier to migrate libraries to AndroidX. You can disable it using "--no-jetifier" flag.
Jetifier found 960 file(s) to forward-jetify. Using 8 workers...
info JS server already running.
info Launching emulator...
error Failed to launch emulator. Reason: Could not start emulator within 30 seconds..
warn Please launch an emulator manually or connect a device. Otherwise app may fail to launch.
info Installing the app...
> Task :app:generateDebugResValues FAILED

Deprecated Gradle features were used in this build, making it incompatible with Gradle 7.0.
Use '--warning-mode all' to show the individual deprecation warnings.
See https://docs.gradle.org/6.0.1/userguide/command_line_interface.html#sec:command_line_warnings
6 actionable tasks: 5 executed, 1 up-to-date

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:generateDebugResValues'.
> Failed to create C:\Users\**\Desktop\ReactNativeProjects\Main\NativeFirebase\android\app\build\generated\res\resValues\debug\values

* 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

BUILD FAILED in 21s

error Failed to install the app. Make sure you have the Android development environment set up: https://reactnative.dev/docs/environment-setup. Run CLI with --verbose flag for more details.
Error: Command failed: gradlew.bat app:installDebug -PreactNativeDevServerPort=8081

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:generateDebugResValues'.
> Failed to create C:\Users\\***\Desktop\ReactNativeProjects\Main\NativeFirebase\android\app\build\generated\res\resValues\debug\values

* 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
firebase react-native
2个回答
0
投票

在项目文件夹中有一个名为'android'的文件夹,您必须使用Android Studio打开它并在模拟器中运行该项目,这将使您安装缺少的或必要的软件包。问题出在SDK软件包上,尤其是gradle将更新您。

“此构建中使用了不推荐使用的Gradle功能,使其与Gradle 7.0不兼容。”

祝你好运。>>


0
投票

删除android/app目录中的构建文件夹,然后再次重新运行项目。

© www.soinside.com 2019 - 2024. All rights reserved.