Discussion Forums  >  Grunts, Groans, Complaints

Replies: 7    Views: 181

zaighamhali
Aspiring developer
Profile
Posts: 16
Reg: Jul 10, 2013
Toronto
1,260
07/11/13 03:35 PM (10 years ago)

Push notifications permission causes app to crash

Hello, I am building an app for my high school. It will help keep all the students up to date with announcements as well as a way to contact any member of the staff and other functions as well. I have went ahead and built the base. I followed all the instructions for Android notifications including getting a project number, api key...I did all that. But still when I launch my app on multiple simulators and devices, when the app launches and asks for permission of push notifications, when YES is selected the app crashes. I have spent hours trying to fix this. PLEASE HELP ME!
 
chris1
Code is Art
Profile
Posts: 3862
Reg: Aug 10, 2012
Austin, TX
50,120
like
07/11/13 06:58 PM (10 years ago)
FYI, you only need to post your question once. More than that gets annoying to some people.
 
Steelflight
Aspiring developer
Profile
Posts: 16
Reg: Feb 20, 2013
Little Rock
160
like
07/11/13 07:56 PM (10 years ago)
Have you tried hooking up an actual device and running the test off of that? I just loaded my AVD simulator and it crashes when I click yes for push notifications as well.
 
ictguy
Aspiring developer
Profile
Posts: 564
Reg: Jun 17, 2011
Mildura, Austra...
15,840
like
07/11/13 08:02 PM (10 years ago)
Have you tried logging into your Google account on the simulator before you launch the app? You need to be logged in to receive push notifications.
 
Steelflight
Aspiring developer
Profile
Posts: 16
Reg: Feb 20, 2013
Little Rock
160
like
07/11/13 08:24 PM (10 years ago)
It may work for zaighamhali, but it did not for me. I logged into my Google account on the virtual device itself and as soon as I click yes on push notifications it suddenly crashes.
 
GoNorthWest
buzztouch Evangelist
Profile
Posts: 8197
Reg: Jun 24, 2011
Oro Valley, AZ
1,000,000
like
07/11/13 11:51 PM (10 years ago)
Having some LogCat output at the time of the crash would be invaluable here. It's almost impossible to figure out what's going on without some debug data. If you could paste that here, it would be awesome! Mark
 
Steelflight
Aspiring developer
Profile
Posts: 16
Reg: Feb 20, 2013
Little Rock
160
like
07/12/13 07:23 AM (10 years ago)
??-?? ??:??:??.???: INFO/<unknown>(<unknown>): [ 07-12 14:18:13.168 1167: 1167 W/ZZ ] ??-?? ??:??:??.???: INFO/<unknown>(<unknown>): BT_screen_splash:registerForPush ??-?? ??:??:??.???: INFO/<unknown>(<unknown>): [ 07-12 14:18:13.168 1167: 1167 W/ZZ ] ??-?? ??:??:??.???: INFO/<unknown>(<unknown>): BT_fileManager:deleteFile rejectedpush.txt ??-?? ??:??:??.???: INFO/<unknown>(<unknown>): [ 07-12 14:18:13.178 1167: 1167 W/ZZ ] ??-?? ??:??:??.???: INFO/<unknown>(<unknown>): BT_screen_splash:device is NOT registered with GCM (Google Cloud Messaging) ??-?? ??:??:??.???: INFO/<unknown>(<unknown>): [ 07-12 14:18:13.188 1167: 1167 D/AndroidRuntime ] ??-?? ??:??:??.???: INFO/<unknown>(<unknown>): Shutting down VM ??-?? ??:??:??.???: INFO/<unknown>(<unknown>): [ 07-12 14:18:13.188 1167: 1167 W/dalvikvm ] ??-?? ??:??:??.???: INFO/<unknown>(<unknown>): threadid=1: thread exiting with uncaught exception (group=0x40a71930) ??-?? ??:??:??.???: INFO/<unknown>(<unknown>): [ 07-12 14:18:13.197 1167: 1167 E/AndroidRuntime ] ??-?? ??:??:??.???: INFO/<unknown>(<unknown>): FATAL EXCEPTION: main ??-?? ??:??:??.???: INFO/<unknown>(<unknown>): java.lang.NoClassDefFoundError: com.google.android.gcm.GCMRegistrar ??-?? ??:??:??.???: INFO/<unknown>(<unknown>): at com.centralhaulingcompany.BT_activity_base.registerForPush(BT_activity_base.java:536) ??-?? ??:??:??.???: INFO/<unknown>(<unknown>): at com.centralhaulingcompany.BT_activity_base$8.onClick(BT_activity_base.java:502) ??-?? ??:??:??.???: INFO/<unknown>(<unknown>): at com.android.internal.app.AlertController$ButtonHandler.handleMessage(AlertController.java:166) ??-?? ??:??:??.???: INFO/<unknown>(<unknown>): at android.os.Handler.dispatchMessage(Handler.java:99) ??-?? ??:??:??.???: INFO/<unknown>(<unknown>): at android.os.Looper.loop(Looper.java:137) ??-?? ??:??:??.???: INFO/<unknown>(<unknown>): at android.app.ActivityThread.main(ActivityThread.java:5041) ??-?? ??:??:??.???: INFO/<unknown>(<unknown>): at java.lang.reflect.Method.invokeNative(Native Method) ??-?? ??:??:??.???: INFO/<unknown>(<unknown>): at java.lang.reflect.Method.invoke(Method.java:511) ??-?? ??:??:??.???: INFO/<unknown>(<unknown>): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:793) ??-?? ??:??:??.???: INFO/<unknown>(<unknown>): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:560) ??-?? ??:??:??.???: INFO/<unknown>(<unknown>): at dalvik.system.NativeStart.main(Native Method) ??-?? ??:??:??.???: INFO/<unknown>(<unknown>): [ 07-12 14:18:13.218 279: 473 W/ActivityManager ] ??-?? ??:??:??.???: INFO/<unknown>(<unknown>): Force finishing activity com.centralhauling/com.centralhaulingcompany.BT_screen_splash ??-?? ??:??:??.???: INFO/<unknown>(<unknown>): [ 07-12 14:18:13.228 279: 473 W/WindowManager ] ??-?? ??:??:??.???: INFO/<unknown>(<unknown>): Failure taking screenshot for (246x410) to layer 21015 ??-?? ??:??:??.???: INFO/<unknown>(<unknown>): [ 07-12 14:18:13.528 279: 296 I/Choreographer ] ??-?? ??:??:??.???: INFO/<unknown>(<unknown>): Skipped 54 frames! The application may be doing too much work on its main thread. ??-?? ??:??:??.???: INFO/<unknown>(<unknown>): [ 07-12 14:18:13.528 37: 37 E/SurfaceFlinger ] ??-?? ??:??:??.???: INFO/<unknown>(<unknown>): ro.sf.lcd_density must be defined as a build property ??-?? ??:??:??.???: INFO/<unknown>(<unknown>): [ 07-12 14:18:13.804 279: 293 W/ActivityManager ] ??-?? ??:??:??.???: INFO/<unknown>(<unknown>): Activity pause timeout for ActivityRecord{41101638 u0 com.centralhauling/com.centralhaulingcompany.BT_screen_splash} ??-?? ??:??:??.???: INFO/<unknown>(<unknown>): [ 07-12 14:18:14.148 279: 296 I/Choreographer ] ??-?? ??:??:??.???: INFO/<unknown>(<unknown>): Skipped 68 frames! The application may be doing too much work on its main thread. ??-?? ??:??:??.???: INFO/<unknown>(<unknown>): [ 07-12 14:18:14.228 412: 412 I/Choreographer ] ??-?? ??:??:??.???: INFO/<unknown>(<unknown>): Skipped 37 frames! The application may be doing too much work on its main thread. ??-?? ??:??:??.???: INFO/<unknown>(<unknown>): [ 07-12 14:18:14.538 37: 37 E/SurfaceFlinger ] ??-?? ??:?
 
ictguy
Aspiring developer
Profile
Posts: 564
Reg: Jun 17, 2011
Mildura, Austra...
15,840
like
07/13/13 01:01 AM (10 years ago)
@steelflight your log suggests that your virtual device is not registered? Look at the line number 6 ... "BT_screen_splash:device is NOT registered with GCM (Google Cloud Messaging) " Also I've never seen all of those "unknown" references in the log output so I'm not sure something else is wrong too? Just some thoughts ... keep digging!
 

Login + Screen Name Required to Post

pointerLogin to participate so you can start earning points. Once you're logged in (and have a screen name entered in your profile), you can subscribe to topics, follow users, and start learning how to make apps like the pros.