App works fine in browser but not working in android ( emulator and device both )

Hi,

I made my first android app using iOnic. My app have two states/pages. Initial page loads successfully, but when I click on Play which changes the state to next page. My app closes in emulator and device. My app works fine when I test on browser. ( with ionic serve ).

I tried remote debugging with Chrome. and got to know when I change the state it actually works on emualator/device too. I see the console.logs written in $timesout . But the app is hidden/close. I am not sure what is happening.

Please help. How do you proceed with debugging such issue?

When you said your app have two states … are you saying you have tested your Android simulator setup working properly for official setup?
I usually download the official version of ionic, test it on with local environment and setups. This will ensure my setup properly. Then, the remain problem should be my app.

It sounds like there are some issues with your code.
Look over your code and run it against something like js-lint/hint.

After that, you should check out the chrome dev tools to see if you have leaky javascript.

Thanks sir, This was copy-paste mistake in my code. :slight_smile:
I have two button in my first page 1. Play 2. Exit . I wrote the code for Exit first and then copy pasted the same code in play. Later on modified the code for ‘Play’ . Last line in method still said ’

ionic.Platform.exitApp();

Such a silly mistake. :blush:
It was working fine in browser though :wink: