首页 > 解决方案 > Android Emulator 无法在 react-native run-android 中运行我的应用

问题描述

运行时出现反应本机配置错误react-native run-android。该命令给出此错误消息:

JS server already running.
Building and installing the app on the device (cd android && gradlew.bat installDebug)...
Error: Could not find or load main class JAVA_OPTS=-Xms256M
Could not install the app on the device, read the error above for details.
Make sure you have an Android emulator running or a device connected and have
set up your Android development environment:
https://facebook.github.io/react-native/docs/getting-started.html

我无法解决这个问题。我安装了所有依赖项。我的模拟器也在运行,但应用程序没有启动。

标签: androidreactjsreact-native

解决方案


尝试设置您的 Android 开发环境。配置环境变量(如路径),确保在运行时找到您的 android sdk 工具(如 adb)!


推荐阅读