我正在尝试在android模拟器上运行我的react原生应用程序。 它运行了一段时间,然后给出了一个错误,即由于JVM堆空间耗尽而将守护进程过期
。 这是我得到的实际错误-
> Task :app:mergeExtDexDebug FAILED
ReactNativeFirebase WARNING: NPM package '@react-native-firebase/auth' depends on '@react-native-firebase/app' v7.2.1 but found v7.3.0, this might cause build issues or runtime crashes.
792 actionable tasks: 2 executed, 790 up-to-date
Expiring Daemon because JVM heap space is exhausted
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:mergeExtDexDebug'.
> A failure occurred while executing com.android.build.gradle.internal.tasks.Workers$ActionFacade
> java.lang.OutOfMemoryError (no error message)
* 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 1m 20s
error Failed to install the app. Make sure you have the Android development environment set up: https://facebook.github.io/react-native/docs/getting-started.html#android-development-environment. Run CLI with --verbose flag for more details.
Error: Command failed: ./gradlew app:installDebug -PreactNativeDevServerPort=8081
我也遇到过这种情况。 我使用的解决方案现在在这里的文档中。
您还可能希望将您的npm包版本钉在react-native-firebase包的package.json中,以确保安装了正确的版本(可能需要先删除yarn.lock文件)。