Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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

like image 734
farhanz95 Avatar asked Sep 05 '25 03:09

farhanz95


2 Answers

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

like image 154
Viky Velmurugan Avatar answered Sep 07 '25 21:09

Viky Velmurugan


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

like image 31
Ramsha Khalid Avatar answered Sep 07 '25 19:09

Ramsha Khalid