AlanMac
Aspiring developer
Profile
Posts: 2612
Reg: Mar 05, 2012
Esher, UK
37,120
09/18/12 10:51 AM (13 years ago)

This (Android) application has stopped unexpectedly

My new BT 2.0 Android app was working fine. Then I added Parse push notifications and now my app crashes in a very repeatable way. I open my app, it runs OK. Then my phone goes to sleep and when it wakes, I see 'The application has stopped unexpectedly. Please try again', with a button to 'Force Close'. Push notifications are received in the notification area, as I would have expected. Logcat looks like this :- 09-18 18:12:02.328: W/ZZ(12163): BT_screen_menuButtons:handleReportToCloudResults previousModified (value on device): Tue, 18 Sep 2012 16:43:17 -0700 09-18 18:12:02.328: W/ZZ(12163): BT_fileManager: saveTextFileToCache: appModified.txt 09-18 18:12:02.338: W/ZZ(12163): BT_screen_menuButtons:handleReportToCloudResults server data not changed, no refresh needed 09-18 18:12:03.458: I/ActivityThread(12163): enter process activity msg = 113 09-18 18:12:03.458: W/dalvikvm(12163): threadid=1: thread exiting with uncaught exception (group=0x2aacc8a0) 09-18 18:12:03.478: E/AndroidRuntime(12163): FATAL EXCEPTION: main 09-18 18:12:03.478: E/AndroidRuntime(12163): java.lang.RuntimeException: Unable to instantiate receiver com.parse.PushBroadcastReceiver: java.lang.ClassNotFoundException: com.parse.PushBroadcastReceiver in loader dalvik.system.PathClassLoader[/system/framework/com.google.android.maps.jar:/mnt/asec/com.ewe-1/pkg.apk] 09-18 18:12:03.478: E/AndroidRuntime(12163): at android.app.ActivityThread.handleReceiver(ActivityThread.java:2831) 09-18 18:12:03.478: E/AndroidRuntime(12163): at android.app.ActivityThread.access$3200(ActivityThread.java:132) 09-18 18:12:03.478: E/AndroidRuntime(12163): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2121) 09-18 18:12:03.478: E/AndroidRuntime(12163): at android.os.Handler.dispatchMessage(Handler.java:99) 09-18 18:12:03.478: E/AndroidRuntime(12163): at android.os.Looper.loop(Looper.java:123) 09-18 18:12:03.478: E/AndroidRuntime(12163): at android.app.ActivityThread.main(ActivityThread.java:4669) 09-18 18:12:03.478: E/AndroidRuntime(12163): at java.lang.reflect.Method.invokeNative(Native Method) 09-18 18:12:03.478: E/AndroidRuntime(12163): at java.lang.reflect.Method.invoke(Method.java:521) 09-18 18:12:03.478: E/AndroidRuntime(12163): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:876) 09-18 18:12:03.478: E/AndroidRuntime(12163): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:634) 09-18 18:12:03.478: E/AndroidRuntime(12163): at dalvik.system.NativeStart.main(Native Method) 09-18 18:12:03.478: E/AndroidRuntime(12163): Caused by: java.lang.ClassNotFoundException: com.parse.PushBroadcastReceiver in loader dalvik.system.PathClassLoader[/system/framework/com.google.android.maps.jar:/mnt/asec/com.ewe-1/pkg.apk] 09-18 18:12:03.478: E/AndroidRuntime(12163): at dalvik.system.PathClassLoader.findClass(PathClassLoader.java:243) 09-18 18:12:03.478: E/AndroidRuntime(12163): at java.lang.ClassLoader.loadClass(ClassLoader.java:573) 09-18 18:12:03.478: E/AndroidRuntime(12163): at java.lang.ClassLoader.loadClass(ClassLoader.java:532) 09-18 18:12:03.478: E/AndroidRuntime(12163): at android.app.ActivityThread.handleReceiver(ActivityThread.java:2822) 09-18 18:12:03.478: E/AndroidRuntime(12163): ... 10 more This is the third time I have built the same version of this app today. I went step by step to add the parse.com additions and tested each step; all was good until the last step, when I added the last bit of code to the bottom of the manifest file. I'm not great at Android, but if anyone has an idea (please), I'm listening!
 
GoNorthWest
buzztouch Evangelist
Profile
Posts: 8197
Reg: Jun 24, 2011
Oro Valley, AZ
1,000,000
like
09/18/12 10:53 AM (13 years ago)
Following because I had the same experience when I was trying to integrate Parse for somebody, and I didn't have time to pursue.
 
AlanMac
Aspiring developer
Profile
Posts: 2612
Reg: Mar 05, 2012
Esher, UK
37,120
like
09/18/12 11:25 AM (13 years ago)
Hi @GoNorthWest, if you are interested in some detail, I can send you an email with a pdf step by step of what I did, if you'd like to try it for yourself. I have previously added parse to a 1.5 BT Android app and it seems fine.
 
GoNorthWest
buzztouch Evangelist
Profile
Posts: 8197
Reg: Jun 24, 2011
Oro Valley, AZ
1,000,000
like
09/18/12 11:29 AM (13 years ago)
I think it might be the same PDF that I was working from, but please send it anyway, just in case! I know it works, because a number of people have it implemented, but no matter what I tried, the app always crashed. MrkFleming at gmail dot com Thanks!
 
AlanMac
Aspiring developer
Profile
Posts: 2612
Reg: Mar 05, 2012
Esher, UK
37,120
like
09/18/12 12:07 PM (13 years ago)
The fact that it crashes for you makes me feel better! Email on its way Alan
 
AlanMac
Aspiring developer
Profile
Posts: 2612
Reg: Mar 05, 2012
Esher, UK
37,120
like
09/19/12 12:38 PM (13 years ago)
Well, I made some progress, more by luck than judgement. The problem is in a line in the manifest (that Parse.com say should be added) <action android:name="android.intent.action.USER_PRESENT" /> If I comment out this one line of code, all is good, the apps stops crashing and the push still works. I have no idea why! I asked the Parse support, they couldn't explain why this worked and suggested "best guess is that the USER_PRESENT action is munged with by buzztouch in some way" Still, at least my app works! Alan
 
GoNorthWest
buzztouch Evangelist
Profile
Posts: 8197
Reg: Jun 24, 2011
Oro Valley, AZ
1,000,000
like
09/19/12 07:26 PM (13 years ago)
Very weird! I'll have to investigate that action and see if I can understand what the impact might be. But the good thing is you got it working...great job! Mark
 

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.