Ionic: Unfortunately, app has stopped


#1

I have designed an ionic app (ionic 3.3.0 and angular 4.1.2). Then i added lazy load to the app. I am getting this error “Unfortunately, app has stopped”, When app loads. Could anyone help me, How to fix it?
Thanks


#2

Don’t write broken code :wink:

Does your app work in ionic serve?
How are you building your app?


#3

@Sujan12 It worked fine in ionic serve and ionic cordova run android. But it was not working when i generated an apk.


#4

Ok good.

How are you building your apk?
What exact commands are you executing?


#5

Do you have any code that tries to figure out the name of the current page from the navigation system? That breaks under minification.


#6

I am using these commands for generating the apk:

  1. ionic cordova build android --prod --release
  2. jarsigner -verbose -sigalg SHA1withRSA -digestalg SHA1 -keystore app.keystore platforms/android/build/outputs/apk/android-release-unsigned.apk appName
  3. $ANDROID_HOME/build-tools/23.0.1/zipalign -v 4 platforms/android/build/outputs/apk/android-release-unsigned.apk appName.apk

#7

No . I m not using anything like that. Its not breaking minification. i m getting " unfortunately app has stopped" while running app in device.


#8
  1. Did the app work properly with ionic serve?
  2. Did the app work with ionic cordova build android?
  3. Did the app work with ionic cordova build android --prod?

#9

I fixed It. The problem was google play services.Because i have push notification in my app. So its needed google play services. So i installed google play services from SDK. Then app worked fine.

Thanks!


#10

i am also facing same problem here… the issue is not solved please suggest me is there any alternative i would check… for the issue to solve…


#11

i also installed google play services from SDK, but no success, app is crashes again, please help me out of this , its very urgent for me.


#12

Do you remember what steps you’ve executed to solve it?


#13

I could solve the problem by removing and re-adding the android platform.