`ionic run android` does not install the application

The device is connected and the package gets built, the CLI shows SUCCESS and even Launched, but the application does not get installed for real.
This has been happening ever since I updated Ionic CLI, i.e 3 days back.

I am able to install the package using adb install. But every time I want to install the app with changes, I have to uninstall the application and build and then use adb to re-install.
This clears the previously saved data on the app, so it has been a major concern for me.

Hoping to know what is wrong on my side/with the updates.

Thank you.

I don’t know why the ionic cli is not working for you, but with adb you can just do adb install -r app.apk to install a new version. No need to uninstall first.

1 Like

After upgrading Cordova from 4.2.0 to 5.0.0 it started happening to me too:

BUILD SUCCESSFUL

Total time: 27.41 secs
Built the following apk(s):
    /Users/denisazevedo/Dev/freela/ionic/bellaitalia-yo-ionic/platforms/android/build/outputs/apk/android-armv7-debug.apk
Using apk: /Users/denisazevedo/Dev/freela/ionic/bellaitalia-yo-ionic/platforms/android/build/outputs/apk/android-armv7-debug.apk
Installing app on device...
Launching application...
LAUNCH SUCCESS

But nothing is installed on the device.

My system information:

Cordova CLI: 5.0.0
Ionic Version: 1.0.0-beta.13
Ionic CLI Version: 1.4.5
Ionic App Lib Version: 0.0.22
ios-deploy version: 1.7.0 
ios-sim version: 3.1.1 
OS: Mac OS X Yosemite
Node Version: v0.12.3
Xcode version: Xcode 6.3.2 Build version 6D2105

Hi,
I have exactly the same problem:

BUILD SUCCESSFUL

Total time: 9.963 secs
Built the following apk(s):
C:\XXX\platforms\android\build\outputs\apk\android-debug.apk
Using apk: C:\XXX\platforms\android\build\outputs\apk\android-debug.apk
Installing app on device…
Launching application…
LAUNCH SUCCESS

But on my phone nothing happens.
However when I install using suggested adb all works fine:

C:\XXX> adb install -r \platforms\android\build\outputs\apk\android-debug.apk
2653 KB/s (2317592 bytes in 0.852s)
pkg: /data/local/tmp/android-debug.apk
Success

It has been reported and a temporary solution was found. Check this link for details.
The CLI of Cordova was the reason for this issue. From this answer:

Find this line of code:

 adb -s ' + resolvedTarget.target + ' install -r -d "' + apk_path + '"

and then remove -d option in the following 2 files:

  1. For cordova run android - platforms\android\cordova\lib\device.js - line 101, in Cordova 5.0.0
  2. For cordova emulate android - platforms\android\cordova\lib\emulator.js - line 311, in Cordova 5.0.0

Now you will see that the app does get installed on your device/emulator.

Thank you Keval, this worked for me :smile:

Downgrading to node 4.2.1 from 5.0.0 was the fix for me (I’m using nvm, so it was super simple). Yay!

Cordova CLI: 5.3.3
Gulp version: CLI version 3.8.11
Gulp local: Local version 3.9.0
Ionic Version: 1.1.0
Ionic CLI Version: 1.7.7
Ionic App Lib Version: 0.6.3
OS: Distributor ID: Fedora Description: Fedora release 22 (Twenty Two)
Node Version: v4.2.1