ionic cordova run android An error occured while running subprocess native-run

孤街醉人 提交于 2020-08-20 03:58:47

问题


I am trying to run my ionic app on an android device (Xiaomi Pocophone) by running the following command:

ionic cordova run android

However, I get the following error message:

BUILD SUCCESSFUL in 7s
42 actionable tasks: 42 up-to-date
Built the following apk(s):
        C:\laragon\www\ionicProject\platforms\android\app\build\outputs\apk\debug\app-debug.apk

> native-run.cmd android --app 

platforms\android\app\build\outputs\apk\debug\app-debug.apk --device

[native-run] Selected hardware device 4d65535f

[native-run] Installing platforms\android\app\build\outputs\apk\debug\app-debug.apk...

[native-run] ERR_UNKNOWN: Non-zero exit code from adb: 1

[ERROR] An error occurred while running subprocess native-run.

native-run.cmd android --app 
platforms\android\app\build\outputs\apk\debug\app-d... exited with exit code 1.


Re-running this command with the --verbose flag may provide more information.

My phone are properly connected via usb type c cable, developer mode is already turned on and usb debugging mode is turn on

i have tried restarting PC and turn off unrelated IDE such as Laragon

Below are Java JDK 8 installed on my computer, i am using Windows 10 Pro

java jdk 8

The Environment Variable system path are as below

1


回答1:


I had the same issue. I allowed "Install via USB" in the developer options in my phone which results success




回答2:


I know it's too late but it might help people in the future. This error is most probably cause by no storage / memory full in phone you are trying to build your apk on. So make some space and try building again.

Check this git issue for the details




回答3:


I don't know if is a general solution for this problem, but I solved this cleaning up my phone's storage/memory.



来源:https://stackoverflow.com/questions/57774309/ionic-cordova-run-android-an-error-occured-while-running-subprocess-native-run

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!