Sudhakar Rapeti
Sudhakar Rapeti

Reputation: 109

My Ionic app works fine on browser but does not open in my phone

my ionic project works fine with ionic serve --lab ,but while copied the.apk file in build folder to my phone and install the app but blank screen appears ,

Please can anyone suggest what might be my problem

my app is using google maps,key is provieded for both app and browser in index.html

Upvotes: 3

Views: 4610

Answers (4)

Sudhakar Rapeti
Sudhakar Rapeti

Reputation: 109

It was a problem with ionic CLI. I've updated it to the latest and reinstalled all dependencies.

Upvotes: -1

paul
paul

Reputation: 1223

+1 for using Chrome Remote Debugging feature. It give you the same output as you would receive from running you app in the browser.

Additionally, I have found that sometimes if your app is already compiled, the ionic CLI doesnt always copy your current files into the APK, and uses the older cached files instead. If you are banging your head against the wall, run the following commands to make sure you have your latest code in your APK.

ionic platform remove android
ionic platform add android
ionic run android

Upvotes: 1

Gaurav Sarma
Gaurav Sarma

Reputation: 2297

Have you tried running it in the emulator ? Since its much easier to see the error logs . Try ionic emulate android -l or ios -l (whichever OS you are building for) and then once the execution starts run the command consolelogs it will log all the activity and you will have a better understanding about why its not working.

Upvotes: 1

Jouke Visser
Jouke Visser

Reputation: 26

I suggest you use the Chrome Remote Debugging feature. I encountered the same, and looked for answers to my symptom for hours. Once I connected to the chrome remote debugger, I got the console.log back, and noticed there was a problem in my routing setup.

Upvotes: 0

Related Questions