0

I have an ionic application that I try to run on the android platform. When I execute

ionic run android

Or

ionic emulate android

I have the following message:

Total time: 0.814 secs Built the following apk(s): /Volumes/DATA/apps/my_app/platforms/android/build/outputs/apk/android-debug.apk ANDROID_HOME=/usr/local/Cellar/android-sdk/24.4.1_1 JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_101.jdk/Contents/Home

The application won't launch.

Here is the result of the ionic info command:

Cordova CLI: 6.4.0 
Ionic CLI Version: 2.1.14
Ionic App Lib Version: 2.1.7
ios-deploy version: 1.7.0 
ios-sim version: 3.1.1 
OS: OS X Yosemite
Node Version: v4.4.5
Xcode version: Xcode 6.3 Build version 6D570

Thanks in advance.

Nabila
  • 191
  • 4
  • 19
  • See this http://stackoverflow.com/questions/29956031/cordova-run-android-executes-fine-but-android-4-1-2-doesnt-start-the-app – Mable John Dec 09 '16 at 08:42
  • @mablevj thanks for your response but I have already seen this issue, I don't have the same problem as I use cordova 6.4 and the **ionic emulate android** command doesn't show **LAUNCH SUCCESS** it pends right after **JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_101.jdk/Contents/Home** – Nabila Dec 09 '16 at 08:57
  • Could you please add your system information by using cli command `ionic info` – Mable John Dec 09 '16 at 09:16
  • @mablevj please see the updates – Nabila Dec 09 '16 at 09:24
  • Have you got any error messages like `Error: No emulator images (avds) found`. – Mable John Dec 09 '16 at 09:27
  • No it pends right after **JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_101.jdk‌​/Contents/Home** I don't have any warnings or errors. – Nabila Dec 09 '16 at 09:30
  • Let us [continue this discussion in chat](http://chat.stackoverflow.com/rooms/130197/discussion-between-mablevj-and-nabila). – Mable John Dec 09 '16 at 09:31

2 Answers2

0

Try remove android platform and reinstall :

ionic platform rm android
ionic platform add android
Rai Vu
  • 1,595
  • 1
  • 20
  • 30
0

After adding the platform, just go to this path file: platforms/android/cordova/lib/device.js

Comment this uninstall function line by changing this:

.return Adb.uninstall(resolvedTarget.target, pkgName)
    .then(function() {
        return Adb.install(resolvedTarget.target, apk_path, {replace: true});
});

to this:

//.return Adb.uninstall(resolvedTarget.target, pkgName)
//    .then(function() {
//         return Adb.install(resolvedTarget.target, apk_path, {replace: true});
//    });
Donald Duck
  • 8,409
  • 22
  • 75
  • 99
Nitesh Pandey
  • 101
  • 1
  • 2