Discussion Forums  >  Crashes, Memory Warnings

Replies: 9    Views: 386

feraco
Aspiring developer
Profile
Posts: 705
Reg: Jan 23, 2012
nyc
15,050
08/08/13 12:51 PM (10 years ago)

Android crash on first open

Hello all I have an android app that crashes as soon as you install it on a device and a simulator. After the crash if you click on the app icon the app works fine, but i have users getting mad about this first crash. I know new android code is coming soon , but i need a quick fix. log cat says this when it crashes- I dont know how to fix this. How can I get my android app to open the first time w/o crashing? 08-08 19:45:18.365: W/ZZ(1062): Cr_menu_advanced:parseScreenData {"childItems":[{"itemId":"1440B471B3BA54D488BED50", "itemType":"BT_menuItem", "loadScreenWithItemId":"291993D37015FC028D163D8", "titleText":"Hjem", "platform":"Both", "rowAccessoryType":"details", "transitionType":"grow"},{"itemId":"77E3CE1A0CD5B54E86DD9F4", "itemType":"BT_menuItem", "loadScreenWithItemId":"48D2795174FE0B239FBCC8D", "titleText":"Send mail til os", "platform":"Both", "rowAccessoryType":"details"},{"itemId":"59C814FFDE38BCA395B3B53", "itemType":"BT_menuItem", "loadScreenWithItemId":"64D92D567B088465DF6F695", "titleText":"Ring til os", "platform":"Both", "rowAccessoryType":"details", "transitionType":"fade"},{"itemId":"8288F7EDC126DBF2BD2279A", "itemType":"BT_menuItem", "loadScreenWithItemId":"4100F0C5B499482E9B8D366", "titleText":"Showcase", "platform":"Both", "rowAccessoryType":"details", "transitionType":"flip"},{"itemId":"73DCE1A02B4F706E0F41E4E", "itemType":"BT_menuItem", "loadScreenWithItemId":"44870C8CB44B6BB2016D626", "titleText":"Shop", "platform":"Both", "rowAccessoryType":"details", "transitionType":"flip"}]} 08-08 19:45:18.365: W/ZZ(1062): parsing1 08-08 19:45:18.365: W/ZZ(1062): parsing3 08-08 19:45:18.375: W/ZZ(1062): parsing4-0 08-08 19:45:18.375: W/ZZ(1062): parsing4-1 08-08 19:45:18.375: W/ZZ(1062): parsing4-2 08-08 19:45:18.385: W/ZZ(1062): parsing4-3 08-08 19:45:18.385: W/ZZ(1062): parsing4-4 08-08 19:45:18.385: W/ZZ(1062): parsing5 08-08 19:45:18.385: W/ZZ(1062): parsing6 08-08 19:45:18.385: W/ZZ(1062): parsing8 08-08 19:45:18.385: D/AndroidRuntime(1062): Shutting down VM 08-08 19:45:18.385: W/dalvikvm(1062): threadid=1: thread exiting with uncaught exception (group=0x40a71930) 08-08 19:45:18.395: E/AndroidRuntime(1062): FATAL EXCEPTION: main 08-08 19:45:18.395: E/AndroidRuntime(1062): java.lang.NullPointerException 08-08 19:45:18.395: E/AndroidRuntime(1062): at com.firmaconnect.Cr_menu_advanced.parseScreenData(Cr_menu_advanced.java:601) 08-08 19:45:18.395: E/AndroidRuntime(1062): at com.firmaconnect.Cr_menu_advanced$1.handleMessage(Cr_menu_advanced.java:911) 08-08 19:45:18.395: E/AndroidRuntime(1062): at android.os.Handler.dispatchMessage(Handler.java:99) 08-08 19:45:18.395: E/AndroidRuntime(1062): at android.os.Looper.loop(Looper.java:137) 08-08 19:45:18.395: E/AndroidRuntime(1062): at android.app.ActivityThread.main(ActivityThread.java:5041) 08-08 19:45:18.395: E/AndroidRuntime(1062): at java.lang.reflect.Method.invokeNative(Native Method) 08-08 19:45:18.395: E/AndroidRuntime(1062): at java.lang.reflect.Method.invoke(Method.java:511) 08-08 19:45:18.395: E/AndroidRuntime(1062): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:793) 08-08 19:45:18.395: E/AndroidRuntime(1062): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:560) 08-08 19:45:18.395: E/AndroidRuntime(1062): at dalvik.system.NativeStart.main(Native Method)
 
WolfTimJ
buzztouch Evangelist
Profile
Posts: 810
Reg: Feb 20, 2011
Rockwall, TX
17,400
like
08/08/13 01:30 PM (10 years ago)
If it crashes first then is ok at second launch I'd look at something wrong in the config.txt in the Android package. Maybe it's running ok after it updates a bad config.txt? Hard to tell for sure with what you pasted above. Tim
 
feraco
Aspiring developer
Profile
Posts: 705
Reg: Jan 23, 2012
nyc
15,050
like
08/08/13 01:39 PM (10 years ago)
The Json is valid. I just tested it, but good guess. Its only on the first time it opens. When it is first installed and opened it crashes. The info pasted above is the log cat info when it crashes.
 
WolfTimJ
buzztouch Evangelist
Profile
Posts: 810
Reg: Feb 20, 2011
Rockwall, TX
17,400
like
08/08/13 01:45 PM (10 years ago)
Just because its valid doesn't mean it's not trying to open a screen that doesn't exist, etc. Easy to test, change it in Eclipse and run it.
 
SmugWimp
Smugger than thou...
Profile
Posts: 6316
Reg: Nov 07, 2012
Tamuning, GU
81,410
like
08/08/13 02:48 PM (10 years ago)
Ya, I had 'valid json' that ended up not being completely 'valid information' once, lol! Give it a good look over... Cheers! -- Smug
 
feraco
Aspiring developer
Profile
Posts: 705
Reg: Jan 23, 2012
nyc
15,050
like
08/08/13 03:18 PM (10 years ago)
Ok I looked it over and changed the config data but same result. But I do have parse push integrated and i get this in log cat about the parse code. Parse push works great but maybe theres something wrong with where i put the code. At the bottom it says something about "that call should instead be in the Application.onCreate. Be sure your Application class is registered in your AndroidManifest.xml with the android:name property of your <application> tag." log cat 08-08 21:57:14.262: E/GCMRegistrar(871): internal error: retry receiver class not set yet 08-08 21:57:14.642: E/AndroidRuntime(871): FATAL EXCEPTION: main 08-08 21:57:14.642: E/AndroidRuntime(871): java.lang.NullPointerException 08-08 21:57:14.642: E/AndroidRuntime(871): at com.firmaconnect.Cr_menu_advanced.parseScreenData(Cr_menu_advanced.java:601) 08-08 21:57:14.642: E/AndroidRuntime(871): at com.firmaconnect.Cr_menu_advanced$1.handleMessage(Cr_menu_advanced.java:911) 08-08 21:57:14.642: E/AndroidRuntime(871): at android.os.Handler.dispatchMessage(Handler.java:99) 08-08 21:57:14.642: E/AndroidRuntime(871): at android.os.Looper.loop(Looper.java:137) 08-08 21:57:14.642: E/AndroidRuntime(871): at android.app.ActivityThread.main(ActivityThread.java:5041) 08-08 21:57:14.642: E/AndroidRuntime(871): at java.lang.reflect.Method.invokeNative(Native Method) 08-08 21:57:14.642: E/AndroidRuntime(871): at java.lang.reflect.Method.invoke(Method.java:511) 08-08 21:57:14.642: E/AndroidRuntime(871): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:793) 08-08 21:57:14.642: E/AndroidRuntime(871): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:560) 08-08 21:57:14.642: E/AndroidRuntime(871): at dalvik.system.NativeStart.main(Native Method) 08-08 22:02:19.922: E/Trace(958): error opening trace file: No such file or directory (2) 08-08 22:02:20.022: E/com.parse.PushService(958): The Parse push service cannot start because Parse.initialize has not yet been called. If you call Parse.initialize from an Activity's onCreate, that call should instead be in the Application.onCreate. Be sure your Application class is registered in your AndroidManifest.xml with the android:name property of your <application> tag. Im not sure where the application.oncreate is in the xml.
 
WolfTimJ
buzztouch Evangelist
Profile
Posts: 810
Reg: Feb 20, 2011
Rockwall, TX
17,400
like
08/08/13 03:29 PM (10 years ago)
When you implemented parse push there were probably some entries to add to the AndroidManifest.xml That's what you're looking for I believe. Tim
 
SmugWimp
Smugger than thou...
Profile
Posts: 6316
Reg: Nov 07, 2012
Tamuning, GU
81,410
like
08/08/13 04:19 PM (10 years ago)
There isn't an 'onCreate' in the XML... it would be in a java file. I'd take a look at BT_activity_base.java or maybe BT_application.java and see if that works out for you. Cheers! -- Smug
 
chris1
Code is Art
Profile
Posts: 3862
Reg: Aug 10, 2012
Austin, TX
50,120
like
08/08/13 05:07 PM (10 years ago)
There's a couple bugs in my plugin that will be fixed when the market opens again. But for now, it looks like your issue is with the parseScreenData() method. Try this: On line 601, replace: myListView.setOnItemClickListener(listItemClickHandler); with: if(childItems.size()>0) myListView.setOnItemClickListener(listItemClickHandler);
 
feraco
Aspiring developer
Profile
Posts: 705
Reg: Jan 23, 2012
nyc
15,050
like
08/08/13 05:08 PM (10 years ago)
Great I will try this!
 

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.