Discussion Forums  >  Crashes, Memory Warnings

Replies: 17    Views: 185

ylaube73
Android Fan
Profile
Posts: 92
Reg: Jan 30, 2012
Poughkeepsie, N...
1,720
03/13/12 09:50 AM (12 years ago)

Force close issue, v2.0, Android, Eclipse

Hello, I has created an app and was able to run it in the google api 2.2 emulator the day before but now it says that it is unable to launch and must force close. Here is the last portion of the LogCat view: 03-13 16:46:28.434: W/ZZ(326): BT_application:getScreenDataByItemId DB3D8B70B207425B62227E9 03-13 16:46:28.434: W/ZZ(326): BT_application:getScreenDataByItemId could not find screen with itemId: DB3D8B70B207425B62227E9 03-13 16:46:28.434: D/AndroidRuntime(326): Shutting down VM 03-13 16:46:28.434: W/dalvikvm(326): threadid=1: thread exiting with uncaught exception (group=0x4001d800) 03-13 16:46:28.443: E/AndroidRuntime(326): FATAL EXCEPTION: main 03-13 16:46:28.443: E/AndroidRuntime(326): java.lang.NullPointerException 03-13 16:46:28.443: E/AndroidRuntime(326): at com.LocustGrove.BT_activity_root.transitionToAppHomeScreen(BT_activity_root.java:222) 03-13 16:46:28.443: E/AndroidRuntime(326): at com.LocustGrove.BT_activity_root$1.run(BT_activity_root.java:352) 03-13 16:46:28.443: E/AndroidRuntime(326): at android.os.Handler.handleCallback(Handler.java:587) 03-13 16:46:28.443: E/AndroidRuntime(326): at android.os.Handler.dispatchMessage(Handler.java:92) 03-13 16:46:28.443: E/AndroidRuntime(326): at android.os.Looper.loop(Looper.java:123) 03-13 16:46:28.443: E/AndroidRuntime(326): at android.app.ActivityThread.main(ActivityThread.java:4627) 03-13 16:46:28.443: E/AndroidRuntime(326): at java.lang.reflect.Method.invokeNative(Native Method) 03-13 16:46:28.443: E/AndroidRuntime(326): at java.lang.reflect.Method.invoke(Method.java:521) 03-13 16:46:28.443: E/AndroidRuntime(326): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868) 03-13 16:46:28.443: E/AndroidRuntime(326): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626) 03-13 16:46:28.443: E/AndroidRuntime(326): at dalvik.system.NativeStart.main(Native Method) 03-13 16:46:36.524: I/Process(326): Sending signal. PID: 326 SIG: 9 Can anyone advise what I can do to correct this?
 
Fred@mySkylla com
Android Fan
Profile
Posts: 5259
Reg: Oct 03, 2011
location unknow...
62,560
like
03/13/12 10:03 AM (12 years ago)
The problem is probably: You're using the emulator (Just don't use it!) Use your Android device, less problems and hairpulling. Your emulator need more memory. (see emulator setup) Your emulator needs external memory. (See emulator setup) You need to allow Install to SD card for the app. (How-To in my Guide) Fred
 
GoNorthWest
buzztouch Evangelist
Profile
Posts: 8197
Reg: Jun 24, 2011
Oro Valley, AZ
1,000,000
like
03/13/12 11:12 AM (12 years ago)
Hi @ylaube73, I'm going to respectfully disagree with @Fred and say that testing your app in the emulator is a valuable and worthwhile activity. Yes, if you have an actual Android device, it's better to test there. But, for those of us who don't have one, the emulator is invaluable, and very beneficial. It's an easy way to test new changes. You'll find that quite a few serious developers use emulators before moving to actual devices...because sometimes bugs in a program can literally kill the device it's being run on. Better to find out in a simulator first! My first suggestion to you would be to delete the current app from your emulator and install a new version. I've found that to help multiple problems in the past. Also, you can increase the amount of memory in your emulator by doing the following: * Find the .android folder on your system, and that's where your AVDs are located. * Open up the file, and put this line in it: disk.dataPartition.size=2048 From what I can tell, this creates an app with a 2Gb storage capacity. I'm not sure what the default size is, but today when I was trying to install a 20MB app, I consistently got the install failed message. After adding that line, I've not had any problems at all. Hope this helps a bit! Mark
 
Fred@mySkylla com
Android Fan
Profile
Posts: 5259
Reg: Oct 03, 2011
location unknow...
62,560
like
03/13/12 11:32 AM (12 years ago)
Mark, I don't disagree that the emulator is invaluable, and very beneficial. In fact I state in my blog "you'll want to learn to use it". It may be an easy way to test new changes once you get it working. You'll find that quite a few serious developers use emulators before moving to actual devices...because sometimes bugs in a program can literally kill the device it's being run on. (True statement but I doubt it has happen or will happen to anyone using Buzztouch.) Better to find out in a simulator first! (Perhaps true if likelyhood was a real possibility.) My position is that starting with the emulator (as I did), only creates additional complexities and problems that are best dealt with later than sooner for various reasons. First and foremost is that 'later' you'll have the knowledge and experience to setup the emulator and use it without problems. Second that the progress you'll make with an actual device far exceeds the capability of the emulator, so why start with second best. Apple requires testing on actual iDevices, a good policy that extends to Android. As always I truly respect your voice and have learned much from you and others on the Forum. Fred
 
GoNorthWest
buzztouch Evangelist
Profile
Posts: 8197
Reg: Jun 24, 2011
Oro Valley, AZ
1,000,000
like
03/13/12 11:37 AM (12 years ago)
Hi Fred, Guess I just got confused. You said "Just don't use it!," so that sounded like a pretty solid comment against the emulator. I was forced to use the emulator because I don't have a device. I suspect many developers don't either (and, unfortunately, they probably don't test their apps at all!). Anyway...as always...I respect your voice and suggestions as well! Mark
 
Fred@mySkylla com
Android Fan
Profile
Posts: 5259
Reg: Oct 03, 2011
location unknow...
62,560
like
03/13/12 11:56 AM (12 years ago)
It's true I don't use them, since I've learned to install on a actual device, but I can see the possibility of doing so. I have a couple of actual devices that proven more valuable and far easier to use. The 'Just Don't Use it!' advice has been found by many to be solid advice. (At least that's the feedback I get.) My experience has been, if you're asking for help and you're using the emulator the almost certain solution is not to use it. I do understand not using it maynot be an option. That's why I gave the additional advice about increasing memory and adding external memory. (Which can be done in devive setup, no need to find .andriod folder). And in the long run learning how to do it by: * Find the .android folder on your system, and that's where your AVDs are located. * Open up the file, and put this line in it: disk.dataPartition.size=2048 may be good, but it's more than most need starting out with. My approach is keep it simple and very slowly raise the level. Fred
 
ylaube73
Android Fan
Profile
Posts: 92
Reg: Jan 30, 2012
Poughkeepsie, N...
1,720
like
03/13/12 12:19 PM (12 years ago)
Gentlemen: Thank you both for the input. I set up the device on my phone and it did work but also followed Mark's advice about deleting the AVD and creating a new one with a larger file size (which I did in the set up screen). Both run my app but now I get endless "Updates Available - do you want to refresh" notices. How should I handle this? By the way - I started this from scratch (I barely know code) and used both of your instructions to get me this far! I am so much closer now than I was a couple of weeks ago (started with 1.4, then 1.5 and now trying 2.0 instead). Keep up the good work!
 
ylaube73
Android Fan
Profile
Posts: 92
Reg: Jan 30, 2012
Poughkeepsie, N...
1,720
like
03/13/12 12:25 PM (12 years ago)
Gentlemen: Thank you both for the input. I set up the device on my phone and it did work but also followed Mark's advice about deleting the AVD and creating a new one with a larger file size (which I did in the set up screen). Both run my app but now I get endless "Updates Available - do you want to refresh" notices. How should I handle this? By the way - I started this from scratch (I barely know code) and used both of your instructions to get me this far! I am so much closer now than I was a couple of weeks ago (started with 1.4, then 1.5 and now trying 2.0 instead). Keep up the good work!
 
ylaube73
Android Fan
Profile
Posts: 92
Reg: Jan 30, 2012
Poughkeepsie, N...
1,720
like
03/13/12 12:25 PM (12 years ago)
Gentlemen: Thank you both for the input. I set up the device on my phone and it did work but also followed Mark's advice about deleting the AVD and creating a new one with a larger file size (which I did in the set up screen). Both run my app but now I get endless "Updates Available - do you want to refresh" notices. How should I handle this? By the way - I started this from scratch (I barely know code) and used both of your instructions to get me this far! I am so much closer now than I was a couple of weeks ago (started with 1.4, then 1.5 and now trying 2.0 instead). Keep up the good work!
 
Fred@mySkylla com
Android Fan
Profile
Posts: 5259
Reg: Oct 03, 2011
location unknow...
62,560
like
03/13/12 12:44 PM (12 years ago)
The endless updates has been happening since the new site was released. I don't remember it from before. That may have been a bug that has been fixed. It's hard to tell for certain. You may wish to re-download the source code. But now is a good time to learn how to copy the config data from the control panel and paste into the BT_config.text file in the source code. (Re-downloading the source is another 'Just Don't do it! things that will make you wish you hadn't done it one day.) If you haven't made any changes to the source code maybe. But if you haven't you've not taken my advice to allow install to SD card. Fred
 
ylaube73
Android Fan
Profile
Posts: 92
Reg: Jan 30, 2012
Poughkeepsie, N...
1,720
like
03/13/12 02:20 PM (12 years ago)
Hi Fred, I still need to tweak the app's appearance some. Would you advise copying the config data to my BT_Config.text first or wait until everything seems complete? I looked at the BT_Config.text file - how is it different than what is on the Control Panel?
 
Fred@mySkylla com
Android Fan
Profile
Posts: 5259
Reg: Oct 03, 2011
location unknow...
62,560
like
03/13/12 02:35 PM (12 years ago)
When you download the source code you get a snapshot of the config data. Any changes via the control panel are after that snapshot, hence the app needs to update to get current data. To wait or not? I say do it now since it's a skill you'll use frequently and best learned sooner than later. Besides then you'll know if the endless updates have stopped. Fred
 
ylaube73
Android Fan
Profile
Posts: 92
Reg: Jan 30, 2012
Poughkeepsie, N...
1,720
like
03/13/12 04:57 PM (12 years ago)
Ok, so I copied and pasted the config data and now I have an error: An internal error occurred during: "Launching Locust_Grove". java.lang.NullPointerException" and the emulator will not open now. I actually was about to throw in the towel and re-download the source code and recreate the whole thing anew but there is no "download the source code" on my application's page.
 
ylaube73
Android Fan
Profile
Posts: 92
Reg: Jan 30, 2012
Poughkeepsie, N...
1,720
like
03/13/12 05:11 PM (12 years ago)
Alright - I thought I would switch methods and try running the app on my device and it seems to have pushed the app through (it now runs) but it has not resolved the updates available/refresh message - despite my copying the config data into the BT_Config folder. Any ideas?
 
Fred@mySkylla com
Android Fan
Profile
Posts: 5259
Reg: Oct 03, 2011
location unknow...
62,560
like
03/13/12 05:13 PM (12 years ago)
I just checked and the download option is there for my applications (BTv1.4 & BTv1.5). But not for BTv2.0 on Buzztouch's server, but I haven't selected an icon if that makes a difference. Fred
 
Fred@mySkylla com
Android Fan
Profile
Posts: 5259
Reg: Oct 03, 2011
location unknow...
62,560
like
03/13/12 05:16 PM (12 years ago)
Is it showing the new data? You may need to clear the cache and uninstall. Fred
 
ylaube73
Android Fan
Profile
Posts: 92
Reg: Jan 30, 2012
Poughkeepsie, N...
1,720
like
03/13/12 05:16 PM (12 years ago)
Thanks for checking - I re-uploaded my icon to see if that would trigger it and no luck.
 
Fred@mySkylla com
Android Fan
Profile
Posts: 5259
Reg: Oct 03, 2011
location unknow...
62,560
like
03/13/12 05:19 PM (12 years ago)
In the past few days I've see several posts on this issue. I haven't see a sure fire solution. It might be worth checking if one was found. Fred
 

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.