Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Android app force closes on a real device but works on emulator

 
Katrinna Smith
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
My app has an action bar with tabs with 3 fragments (1-list fragment with the list of running processes, 2-battery and memory info, 3-just some text). It works fine, with no errors on the emulator, but on a real device it starts ok, I go through the tabs several times(I left the phone to go into sleep mode and back and the app still worked) and then it unexpectedly force closes. My phone isn't seen among the adb devices, so I don't know if there are any errors in the logcat(the one in eclipse).
I installed a LogCat app to my phone and I think these are the errors, but I'm not sure they are related to my app, because I've uninstalled the app several hours ago and the errors occured just now according to the timestamps:

Please help me!!!

So, I finally managed to make my phone visible and here are the errors




and the code for the class Battery


 
Steve Luke
Bartender
Posts: 4181
22
IntelliJ IDE Java Python
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You have to do a better job of tracking down the error message. If the phone doesn't show up in Eclipse then turn on development tools and reconnect the phone. The error message doesn't really look like it is related to your error - but it is hard to tell. You should also be aware that the on-phone logcat apps really only work on phones that have been rooted (so if you didn't root your phone, the app is useless).
 
Katrinna Smith
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Steve Luke wrote:You have to do a better job of tracking down the error message. If the phone doesn't show up in Eclipse then turn on development tools and reconnect the phone. The error message doesn't really look like it is related to your error - but it is hard to tell. You should also be aware that the on-phone logcat apps really only work on phones that have been rooted (so if you didn't root your phone, the app is useless).


I tried to turn the debugging on , tried other things from the internet yet I still can't get my phone to be seen, so that's why I installed the logcat app on my phone
As for the logcat app, I didn't know the phone had to be rooted. I don't want to root my phone, so is there any other way to find the problem?
 
Steve Luke
Bartender
Posts: 4181
22
IntelliJ IDE Java Python
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What you should be doing is diving in to why you cant see your phone in ADB. Without that the best you can do is guess about what is happening. And we arent even equipped to do that since we know nothing about your app.
 
Ulf Dittmer
Rancher
Posts: 42969
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
A frequent issue why ADB does not work out of the box on Windows is incorrect or no USB drivers. The Android developer site has a lengthy article on how to resolve that. It can be tricky.

Once you have the right drivers, try the different ways Windows offers to connect - for one device I had to choose "camera" instead of "USB storage".

And, of course, make sure "USB Debugging" is enabled on the device.
 
Don't get me started about those stupid light bulbs.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic