SM
Lost but trying
Profile
Posts: 9
Reg: Dec 08, 2012
London
390
04/29/13 12:30 PM (12 years ago)

Android Run Time Error in Emulator

Hi, Unfortunately for some reason after updating my app on buzztouch it will no longer load correctly using the Android Emulator. On clicking on the icon it states "The application has stopped working unexpectedly. Please try again". The console is below: [2013-04-29 20:18:14 - selfmeducatethirdyearmedicineexamquestions_v20_Android] Android Launch! [2013-04-29 20:18:14 - selfmeducatethirdyearmedicineexamquestions_v20_Android] adb is running normally. [2013-04-29 20:18:14 - selfmeducatethirdyearmedicineexamquestions_v20_Android] Performing com.selfmeducatethirdyearmedicineexamquestions.BT_activity_root activity launch [2013-04-29 20:18:15 - selfmeducatethirdyearmedicineexamquestions_v20_Android] Failed to find an AVD compatible with target 'Google APIs'. [2013-04-29 20:18:25 - selfmeducatethirdyearmedicineexamquestions_v20_Android] Still no compatible AVDs with target 'Google APIs': Aborting launch. [2013-04-29 20:18:25 - selfmeducatethirdyearmedicineexamquestions_v20_Android] Performing com.selfmeducatethirdyearmedicineexamquestions.BT_activity_root activity launch [2013-04-29 20:18:27 - selfmeducatethirdyearmedicineexamquestions_v20_Android] Uploading selfmeducatethirdyearmedicineexamquestions_v20_Android.apk onto device 'emulator-5554' [2013-04-29 20:18:33 - selfmeducatethirdyearmedicineexamquestions_v20_Android] Installing selfmeducatethirdyearmedicineexamquestions_v20_Android.apk... [2013-04-29 20:18:51 - selfmeducatethirdyearmedicineexamquestions_v20_Android] Success! [2013-04-29 20:18:52 - selfmeducatethirdyearmedicineexamquestions_v20_Android] Starting activity com.selfmeducatethirdyearmedicineexamquestions.BT_activity_root on device emulator-5554 The logcat is below: 04-29 19:19:09.749: E/AndroidRuntime(304): FATAL EXCEPTION: main 04-29 19:19:09.749: E/AndroidRuntime(304): java.lang.NullPointerException 04-29 19:19:09.749: E/AndroidRuntime(304): at com.selfmeducatethirdyearmedicineexamquestions.BT_activity_root.transitionToAppHomeScreen(BT_activity_root.java:198) 04-29 19:19:09.749: E/AndroidRuntime(304): at com.selfmeducatethirdyearmedicineexamquestions.BT_activity_root$1.handleMessage(BT_activity_root.java:307) 04-29 19:19:09.749: E/AndroidRuntime(304): at android.os.Handler.dispatchMessage(Handler.java:99) 04-29 19:19:09.749: E/AndroidRuntime(304): at android.os.Looper.loop(Looper.java:123) 04-29 19:19:09.749: E/AndroidRuntime(304): at android.app.ActivityThread.main(ActivityThread.java:4627) 04-29 19:19:09.749: E/AndroidRuntime(304): at java.lang.reflect.Method.invokeNative(Native Method) 04-29 19:19:09.749: E/AndroidRuntime(304): at java.lang.reflect.Method.invoke(Method.java:521) 04-29 19:19:09.749: E/AndroidRuntime(304): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868) 04-29 19:19:09.749: E/AndroidRuntime(304): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626) 04-29 19:19:09.749: E/AndroidRuntime(304): at dalvik.system.NativeStart.main(Native Method) It extremely frustrating as I was ready to submit the app but can't do it without checking the updates are all ok! Thank you very much for any help you can be.
 
GoNorthWest
buzztouch Evangelist
Profile
Posts: 8197
Reg: Jun 24, 2011
Oro Valley, AZ
1,000,000
like
04/29/13 02:01 PM (12 years ago)
Can you paste in some of what you saw in LogCat prior to the Fatal Exception? That's where we'd find an indication of what went wrong. Thanks! Mark
 
SM
Lost but trying
Profile
Posts: 9
Reg: Dec 08, 2012
London
390
like
04/29/13 02:19 PM (12 years ago)
Ok. Here is the lead up to it: 04-29 19:24:09.910: I/Process(304): Sending signal. PID: 304 SIG: 9 04-29 19:25:56.068: W/ZZ(312): selfmeducatethirdyearmedicineexamquestions_appDelegate: onCreate 04-29 19:25:56.068: W/ZZ(312): selfmeducatethirdyearmedicineexamquestions_appDelegate:loadAudioPlayer 04-29 19:25:56.138: W/ZZ(312): BT_application: Creating root-app object. 04-29 19:25:56.158: W/ZZ(312): BT_device: Creating root-device object. 04-29 19:25:56.178: W/ZZ(312): BT_device: This device uses an Android display density of: 240dpi (dots per inch) 04-29 19:25:56.208: W/ZZ(312): BT_device: This device can take pictures. 04-29 19:25:56.208: W/ZZ(312): BT_device: This device can take videos. 04-29 19:25:56.228: W/ZZ(312): BT_device: This device can send emails. 04-29 19:25:56.268: W/ZZ(312): BT_device: This device is GPS capable. 04-29 19:25:56.278: W/ZZ(312): BT_user: Creating root-user object. 04-29 19:25:56.458: W/ZZ(312): BT_activity_root:onCreate 04-29 19:25:56.548: W/ZZ(312): selfmeducatethirdyearmedicineexamquestions_appDelegate:SoundEffectLoader:doInBackground initSoundEffects 04-29 19:25:56.828: D/dalvikvm(312): GC_EXTERNAL_ALLOC freed 1421 objects / 103272 bytes in 256ms 04-29 19:25:56.948: W/ZZ(312): selfmeducatethirdyearmedicineexamquestions_appDelegate:SoundEffectLoader:doInBackground initSoundEffects DISABLED 04-29 19:25:57.000: W/ZZ(312): BT_activity_root:loadAppData 04-29 19:25:57.080: W/ZZ(312): BT_device:updateDeviceConnectionType: ConnectionType: CELL 04-29 19:25:57.080: W/ZZ(312): BT_device:updateDeviceSize This device has a screen size of: 480 (width) x 800 (height). 04-29 19:25:57.100: W/ZZ(312): BT_device:updateDeviceSize This application considers this to be a "small device" 04-29 19:25:57.100: W/ZZ(312): BT_device:updateDeviceSize This device is in "portrait" orientation. 04-29 19:25:57.121: W/ZZ(312): BT_activity_root:loadAppData loading BT_config.txt from /assests folder in Eclipse project... 04-29 19:25:57.902: W/ZZ(312): BT_fileManager: readTextFileFromAssets: "/BT_config.txt" 04-29 19:25:59.381: D/dalvikvm(312): GC_FOR_MALLOC freed 646 objects / 265064 bytes in 859ms 04-29 19:25:59.990: D/dalvikvm(312): GC_FOR_MALLOC freed 358 objects / 311128 bytes in 211ms 04-29 19:26:00.031: I/dalvikvm-heap(312): Grow heap (frag case) to 3.132MB for 261542-byte allocation 04-29 19:26:00.459: D/dalvikvm(312): GC_FOR_MALLOC freed 0 objects / 0 bytes in 400ms 04-29 19:26:00.721: D/dalvikvm(312): GC_FOR_MALLOC freed 51 objects / 186472 bytes in 237ms 04-29 19:26:00.721: W/ZZ(312): BT_activity_root:loadAppData loaded BT_config.txt from /assets folder successfully... 04-29 19:26:00.768: W/ZZ(312): BT_application: getDataURLFromAppData 04-29 19:26:02.080: W/ZZ(312): BT_activity_root:loadAppData BT_config.txt file does use a dataURL for remote updates... 04-29 19:26:02.099: W/ZZ(312): BT_activity_root:loadAppData cachedAppConfig.txt does not exist in the cache... 04-29 19:26:02.099: W/ZZ(312): BT_application: validateApplicationData 04-29 19:26:03.408: D/dalvikvm(312): GC_FOR_MALLOC freed 8042 objects / 555568 bytes in 336ms 04-29 19:26:04.088: W/ZZ(312): BT_activity_root: application data appears to be valid JSON... 04-29 19:26:04.088: W/ZZ(312): BT_application: parseJSONData 04-29 19:26:05.558: W/ZZ(312): BT_application: parsing core settings... 04-29 19:26:05.558: W/ZZ(312): BT_application: parsing themes... 04-29 19:26:05.613: W/ZZ(312): BT_application: parsing tabs... 04-29 19:26:05.613: W/ZZ(312): BT_application: parsing screens... 04-29 19:26:05.633: W/ZZ(312): BT_application:parseJSONData done parsing application data 04-29 19:26:05.669: W/ZZ(312): BT_activity_root:transitionToAppHomeScreen 04-29 19:26:05.679: W/ZZ(312): BT_activity_root:transitionToAppHomeScreen splash screen with itemId: 9F654F0B1C64DE7D42B7058 04-29 19:26:05.679: W/ZZ(312): BT_application:getScreenDataByItemId with itemId: = "9F654F0B1C64DE7D42B7058" 04-29 19:26:05.689: W/ZZ(312): BT_application:getScreenDataByItemId could not find screen with itemId: "9F654F0B1C64DE7D42B7058" 04-29 19:26:05.718: D/AndroidRuntime(312): Shutting down VM 04-29 19:26:05.718: W/dalvikvm(312): threadid=1: thread exiting with uncaught exception (group=0x4001d800) 04-29 19:26:05.769: E/AndroidRuntime(312): FATAL EXCEPTION: main 04-29 19:26:05.769: E/AndroidRuntime(312): java.lang.NullPointerException 04-29 19:26:05.769: E/AndroidRuntime(312): at com.selfmeducatethirdyearmedicineexamquestions.BT_activity_root.transitionToAppHomeScreen(BT_activity_root.java:198) 04-29 19:26:05.769: E/AndroidRuntime(312): at com.selfmeducatethirdyearmedicineexamquestions.BT_activity_root$1.handleMessage(BT_activity_root.java:307) 04-29 19:26:05.769: E/AndroidRuntime(312): at android.os.Handler.dispatchMessage(Handler.java:99) 04-29 19:26:05.769: E/AndroidRuntime(312): at android.os.Looper.loop(Looper.java:123) 04-29 19:26:05.769: E/AndroidRuntime(312): at android.app.ActivityThread.main(ActivityThread.java:4627) 04-29 19:26:05.769: E/AndroidRuntime(312): at java.lang.reflect.Method.invokeNative(Native Method) 04-29 19:26:05.769: E/AndroidRuntime(312): at java.lang.reflect.Method.invoke(Method.java:521) 04-29 19:26:05.769: E/AndroidRuntime(312): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868) 04-29 19:26:05.769: E/AndroidRuntime(312): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626) 04-29 19:26:05.769: E/AndroidRuntime(312): at dalvik.system.NativeStart.main(Native Method)
 
chris1
Code is Art
Profile
Posts: 3862
Reg: Aug 10, 2012
Austin, TX
50,120
like
04/29/13 02:21 PM (12 years ago)
Ah yes - that's why I was so confused! Here's the line that really matters: 04-29 19:26:05.689: W/ZZ(312): BT_application:getScreenDataByItemId could not find screen with itemId: "9F654F0B1C64DE7D42B7058" You are trying to load a screen that isn't there. If you look in your JSON/Configuration Data, you should be able to do a search and find for that itemId and see what the app is trying to load.
 
GoNorthWest
buzztouch Evangelist
Profile
Posts: 8197
Reg: Jun 24, 2011
Oro Valley, AZ
1,000,000
like
04/29/13 02:21 PM (12 years ago)
Looks like a Splash Screen problem: 04-29 19:26:05.679: W/ZZ(312): BT_activity_root:transitionToAppHomeScreen splash screen with itemId: 9F654F0B1C64DE7D42B7058 04-29 19:26:05.679: W/ZZ(312): BT_application:getScreenDataByItemId with itemId: = "9F654F0B1C64DE7D42B7058" 04-29 19:26:05.689: W/ZZ(312): BT_application:getScreenDataByItemId could not find screen with itemId: "9F654F0B1C64DE7D42B7058" 04-29 19:26:05.718: D/AndroidRuntime(312): Shutting down VM Do you have an actual Splash Screen screen defined, and linked to the Splash Screen section of the Theme > Default Theme area in your control panel?
 
SM
Lost but trying
Profile
Posts: 9
Reg: Dec 08, 2012
London
390
like
04/29/13 02:30 PM (12 years ago)
Thanks GoNorthWest and Chris 1. I did have a splash screen but it did'nt work so I decided to delete it. Shall I add the splash screen back in?
 
chris1
Code is Art
Profile
Posts: 3862
Reg: Aug 10, 2012
Austin, TX
50,120
like
04/29/13 02:31 PM (12 years ago)
just make sure on your "Theme" that you remove the reference to the screen.
 
GoNorthWest
buzztouch Evangelist
Profile
Posts: 8197
Reg: Jun 24, 2011
Oro Valley, AZ
1,000,000
like
04/29/13 02:32 PM (12 years ago)
No need to add it back in, just make sure you're no longer referencing it in the Themes section. If you've removed both the screen itself, and the reference to it in Themes, you should be OK. Make sure you sync up (copy the server version to your local file) the BT_Config.txt file after you make those changes. Mark
 
SM
Lost but trying
Profile
Posts: 9
Reg: Dec 08, 2012
London
390
like
05/05/13 01:30 PM (12 years ago)
Thanks guys that has totally sorted the problem. The app also forces closure whenever photo questions (in quiz) appear despite the photo's being enter onto the BT_Docs folder before opening the app in Eclipse? The logcat is below: 05-05 20:46:03.786: W/ZZ(361): BT_screen_quiz:answerClick 05-05 20:46:03.786: W/ZZ(361): BT_screen_quiz:answerClick The selected answer was: "Insertion of a temporary pacemaker" 05-05 20:46:03.866: W/ZZ(361): BT_screen_quiz:fadeImageIn 05-05 20:46:03.866: W/ZZ(361): BT_screen_quiz:fadeImageIn 05-05 20:46:03.936: W/ZZ(361): BT_screen_quiz:fadeImageOut 05-05 20:46:03.946: W/ZZ(361): BT_screen_quiz:fadeImageOut 05-05 20:46:04.826: W/ZZ(361): BT_screen_quiz:answerClick 05-05 20:46:04.826: W/ZZ(361): BT_screen_quiz:answerClick The selected answer was: "Insertion of a temporary pacemaker" 05-05 20:46:06.099: W/ZZ(361): BT_screen_quiz:showNextQuestion Question Number: 12 05-05 20:46:06.106: W/ZZ(361): BT_screen_quiz:showQuestionImage 05-05 20:46:06.120: W/ZZ(361): BT_screen_quiz:slideButtons 05-05 20:46:06.120: W/ZZ(361): BT_screen_quiz:slideQuestion 05-05 20:46:06.140: W/ZZ(361): BT_screen_quiz:showNextQuestion. "Which of the following is the correct description of this arrhythmia?" 05-05 20:46:06.140: W/ZZ(361): BT_screen_quiz:showNextQuestion. Setting image from /drawables directory: "Cardiology SBA 15.jpg" 05-05 20:46:06.160: W/ResourceType(361): No package identifier when getting value for resource number 0x00000000 05-05 20:46:06.166: W/ZZ(361): BT_fileManager:getDrawableFromResourcesByName An exception occurred trying to get the drawable named: Cardiology SBA 15.jpg 05-05 20:46:06.186: D/AndroidRuntime(361): Shutting down VM 05-05 20:46:06.186: W/dalvikvm(361): threadid=1: thread exiting with uncaught exception (group=0x4001d800) 05-05 20:46:06.226: E/AndroidRuntime(361): FATAL EXCEPTION: main 05-05 20:46:06.226: E/AndroidRuntime(361): java.lang.NullPointerException 05-05 20:46:06.226: E/AndroidRuntime(361): at com.selfmeducatethirdyearmedicineexamquestions.BT_screen_quiz.showNextQuestion(BT_screen_quiz.java:1064) 05-05 20:46:06.226: E/AndroidRuntime(361): at com.selfmeducatethirdyearmedicineexamquestions.BT_screen_quiz$6.run(BT_screen_quiz.java:1313) 05-05 20:46:06.226: E/AndroidRuntime(361): at android.os.Handler.handleCallback(Handler.java:587) 05-05 20:46:06.226: E/AndroidRuntime(361): at android.os.Handler.dispatchMessage(Handler.java:92) 05-05 20:46:06.226: E/AndroidRuntime(361): at android.os.Looper.loop(Looper.java:123) 05-05 20:46:06.226: E/AndroidRuntime(361): at android.app.ActivityThread.main(ActivityThread.java:4627) 05-05 20:46:06.226: E/AndroidRuntime(361): at java.lang.reflect.Method.invokeNative(Native Method) 05-05 20:46:06.226: E/AndroidRuntime(361): at java.lang.reflect.Method.invoke(Method.java:521) 05-05 20:46:06.226: E/AndroidRuntime(361): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868) 05-05 20:46:06.226: E/AndroidRuntime(361): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626) 05-05 20:46:06.226: E/AndroidRuntime(361): at dalvik.system.NativeStart.main(Native Method) 05-05 20:46:10.286: I/Process(361): Sending signal. PID: 361 SIG: 9 Any help would be very much appreciated. Is it ok to call a photo "Cardiology SBA 15.jpg" as here?
 
GoNorthWest
buzztouch Evangelist
Profile
Posts: 8197
Reg: Jun 24, 2011
Oro Valley, AZ
1,000,000
like
05/05/13 02:03 PM (12 years ago)
It's this image that's the problem: 05-05 20:46:06.140: W/ZZ(361): BT_screen_quiz:showNextQuestion. Setting image from /drawables directory: "Cardiology SBA 15.jpg" In Android, you must use the a_z0_9 naming convention, which means no caps, spaces, dashes or special characters. Fix that, and you'll probably be good! Mark
 
chris1
Code is Art
Profile
Posts: 3862
Reg: Aug 10, 2012
Austin, TX
50,120
like
05/05/13 02:05 PM (12 years ago)
Yep - one of the things about Android that drives me crazy
 
SM
Lost but trying
Profile
Posts: 9
Reg: Dec 08, 2012
London
390
like
05/05/13 05:21 PM (12 years ago)
I thought that might be the case. I tried to change them all to lower case, no numbers or symbols. But still does not work. Annoyingly works fine on Xcode. Just Android. This is the logcat: 05-06 00:13:08.194: W/ZZ(381): BT_screen_quiz:showNextQuestion Question Number: 2 05-06 00:13:08.194: W/ZZ(381): BT_screen_quiz:showQuestionImage 05-06 00:13:08.223: W/ZZ(381): BT_screen_quiz:slideButtons 05-06 00:13:08.235: W/ZZ(381): BT_screen_quiz:slideQuestion 05-06 00:13:08.243: W/ZZ(381): BT_screen_quiz:showNextQuestion. "Which single most likely cause of the gas pattern on this plain abdominal film?" 05-06 00:13:08.243: W/ZZ(381): BT_screen_quiz:showNextQuestion. Setting image from /drawables directory: "generalsurgerythree.jpg" 05-06 00:13:08.255: W/ResourceType(381): No package identifier when getting value for resource number 0x00000000 05-06 00:13:08.263: W/ZZ(381): BT_fileManager:getDrawableFromResourcesByName An exception occurred trying to get the drawable named: generalsurgerythree.jpg 05-06 00:13:08.283: D/AndroidRuntime(381): Shutting down VM 05-06 00:13:08.296: W/dalvikvm(381): threadid=1: thread exiting with uncaught exception (group=0x4001d800) 05-06 00:13:08.323: E/AndroidRuntime(381): FATAL EXCEPTION: main 05-06 00:13:08.323: E/AndroidRuntime(381): java.lang.NullPointerException 05-06 00:13:08.323: E/AndroidRuntime(381): at com.selfmeducatethirdyearmedicineexamquestions.BT_screen_quiz.showNextQuestion(BT_screen_quiz.java:1064) 05-06 00:13:08.323: E/AndroidRuntime(381): at com.selfmeducatethirdyearmedicineexamquestions.BT_screen_quiz$6.run(BT_screen_quiz.java:1313) 05-06 00:13:08.323: E/AndroidRuntime(381): at android.os.Handler.handleCallback(Handler.java:587) 05-06 00:13:08.323: E/AndroidRuntime(381): at android.os.Handler.dispatchMessage(Handler.java:92) 05-06 00:13:08.323: E/AndroidRuntime(381): at android.os.Looper.loop(Looper.java:123) 05-06 00:13:08.323: E/AndroidRuntime(381): at android.app.ActivityThread.main(ActivityThread.java:4627) 05-06 00:13:08.323: E/AndroidRuntime(381): at java.lang.reflect.Method.invokeNative(Native Method) 05-06 00:13:08.323: E/AndroidRuntime(381): at java.lang.reflect.Method.invoke(Method.java:521) 05-06 00:13:08.323: E/AndroidRuntime(381): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868) 05-06 00:13:08.323: E/AndroidRuntime(381): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626) 05-06 00:13:08.323: E/AndroidRuntime(381): at dalvik.system.NativeStart.main(Native Method) 05-06 00:13:12.696: I/Process(381): Sending signal. PID: 381 SIG: 9 Any thoughts on how to correct it?
 
GoNorthWest
buzztouch Evangelist
Profile
Posts: 8197
Reg: Jun 24, 2011
Oro Valley, AZ
1,000,000
like
05/05/13 05:30 PM (12 years ago)
Are you absolutely sure that generalsurgerythree.jpg exists in res > drawable? And that it's named correctly if it indeed exists? Also...I've seen some instances where long file names seem to cause problems in Android. If the file is there, and all good, try shortening it up a bit. Then try a Product...Clean, just to break any bad links, and compile again. Android can be super annoying, but it is what it is! Mark
 
SM
Lost but trying
Profile
Posts: 9
Reg: Dec 08, 2012
London
390
like
05/06/13 07:46 AM (12 years ago)
I added the files to BT_Docs is that the correct place? Shortening the name hasn't seemed to make a difference. Thanks for the help Martin
 

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.