我使用 react-native-init 命令创建了我的应用。我已经安装了 android studio 和 Pixel 2 API 28 。我可以成功运行我的Android模拟器。然后,在我的项目目录中运行 react-native run-android 。 但是,在我的android模拟器上没有任何问题,我在终端中得到了以下输出:
info Starting JS server...
info Building and installing the app on the device (cd android && ./gradlew app:installDebug)...
> Task :app:installDebug
01:44:46 V/ddms: execute: running am get-config
01:44:46 V/ddms: execute 'am get-config' on 'emulator-5554' : EOF hit. Read: -1
01:44:46 V/ddms: execute: returning
Installing APK 'app-debug.apk' on 'Pixel_2_API_28(AVD) - 9' for app:debug
01:44:46 D/app-debug.apk: Uploading app-debug.apk onto device 'emulator-5554'
01:44:46 D/Device: Uploading file onto device 'emulator-5554'
01:44:46 D/ddms: Reading file permision of /home/kasra/Documents/Linkap/nativeReact/android/app/build/outputs/apk/debug/app-debug.apk as: rw-r--r--
01:44:46 V/ddms: execute: running pm install -r -t "/data/local/tmp/app-debug.apk"
01:44:47 V/ddms: execute 'pm install -r -t "/data/local/tmp/app-debug.apk"' on 'emulator-5554' : EOF hit. Read: -1
01:44:47 V/ddms: execute: returning
01:44:47 V/ddms: execute: running rm "/data/local/tmp/app-debug.apk"
01:44:47 V/ddms: execute 'rm "/data/local/tmp/app-debug.apk"' on 'emulator-5554' : EOF hit. Read: -1
01:44:47 V/ddms: execute: returning
Installed on 1 device.
BUILD SUCCESSFUL in 1s
26 actionable tasks: 1 executed, 25 up-to-date
/bin/sh: 1: adb: not found
info Starting the app (adb shell am start -n com.nativereact/com.nativereact.MainActivity...
react-native-cli:2.0.1
本机:0.59.5
Android Studio 3.4
Build#AI-183.5429.30.34.5452501,建于2019年4月10日
JRE:1.8.0_152-release-1343-b16-5323222 amd64
JVM:JetBrains s.r.o的OpenJDK 64位服务器VM
Linux 4.15.0-47-通用
答案 0 :(得分:0)
您是否尝试过仅在终端中运行react-native start并运行模拟器?我发现本机运行-和