Running 'emulate android' launching emulator but not opening app


#1

I’ve been following the ‘Getting Started’ tutorials and have gotten as far as the testing on the Android emulator. Whenever I run the ‘ionic emulate android’ command, the emulator opens but the app doesn’t run. Is there something else I should be doing/have installed in order for the emulator to load the app?

Thanks.


#2

Kind of really open ended. There could be a lot of things that are going wrong here. Do you have the android SDK added to your path? What os are you on? Do you have Ant installed?

We need some more information to help out


#3

I also got same issue working on Windows 7.
When I run the ‘ionic emulate android’ command, the emulator opens but the app doesn’t run.

According to console log, showed below
・“ERROR : unable to find project C:\Users[username]\myApp\platforms\android\ant-build directory, could not locate .apk”
・“Error: C:\Users[username]\myApp\platforms\android\cordova\run.bat: Command fa
iled with exit code 2
at ChildProcess.whenDone (C:\Users[username]\AppData\Roaming\npm\node_mod
ules\cordova\node_modules\cordova-lib\src\cordova\superspawn.js:131:23)
at ChildProcess.EventEmitter.emit (events.js:98:17)
at maybeClose (child_process.js:753:16)
at Process.ChildProcess._handle.onexit (child_process.js:820:5)”

There are no “ant-build” directory.
I think I was able to follow instructions such getting-started and Getting Everything Installed

I set ant, java, android tools and platform-tools to the path.
I have solved some issues step by step from proxy settings, installing.
But I cannot find any solutions above issue.

Java ver:jdk1.7.0_51
I just installed node.js, ant and android today 2014/Jun/12.

I just wonder why no success message shows when I run "ionic build android"
except “Running build task…
Building platform android
Running command: C:\Users[username]\myApp\platforms\android\cordova\build.bat”.


#5

I am very sorry. Plobrem is I failed to unzip ant program(apach-ant-1.x.x-bin.zip). Some files size were 0 kb. After unzip ant program properly, I have overcome this issue.


#6

I am facing the same problem, command prompt does not show any error message, emulator opens up without problem but myApp not open in emulator(nor it shows in App section). I am using Windows 7, node/Java/Ant/Android Studio is installed. last lines of command prompt window when running the command -> ionic emulate android are as follows:

>    [move] Moving 1 file to C:\Users\user1\AppData\Roaming\npm\freshlypress\pla
> tforms\android\ant-build
>      [move] Moving 1 file to C:\Users\user1\AppData\Roaming\npm\freshlypress\pla
> tforms\android\CordovaLib\ant-build

> debug:

> BUILD SUCCESSFUL
> Total time: 8 seconds
> Built the following apk(s):
>     C:\Users\user1\AppData\Roaming\npm\freshlypress\platforms\android\ant-build\
> CordovaApp-debug.apk
> WARNING : no emulator specified, defaulting to Nex5
> Waiting for emulator...
> emulator: device fd:1012

>HAX is working and emulator runs in fast virt mode
> creating window 0 0 438 729

ps: $ > ionic serve is working for me


#8

i have same your a problem?
but my program apach-ant is complete?


#9

Did you solve this problem?

I have the same message here and still doesn’t open the app inside the emulator.

BUILD SUCCESSFUL

Total time: 3.049 secs
Built the following apk(s):
    C:\Users\Sistema\Documents\robodroid_cordova\robodroid\platforms\android\bui
ld\outputs\apk\android-debug.apk
Installing app on emulator...
Using apk: C:\Users\Sistema\Documents\robodroid_cordova\robodroid\platforms\andr
oid\build\outputs\apk\android-debug.apk
Launching application...
LAUNCH SUCCESS

#10

same here :confused:


#11

Just fixed here. It was my emulator device that was with the API 16. Just updated to API 21 and its working like a charm :smile:


#12

Do u know why it works only on later emulator and not 16???

I hope to get it work on 16 as well :frowning: