简体   繁体   中英

Android app crashes on constructing Gson object…unable to see exception details

I'm working on a little app and retrieving data from a server. In debug mode I can see the properly formatted JSON string is received and stored in my var. Right after I try instantiating a Gson object ( using Gson gson = new Gson(); it dies on this line) and it just dies... I can't seem to get any output in log cat so I can't see the exception being thrown. I've just migrated from windows to Ubuntu (64 bit) so it's quite possible I'm missing something in my set up but everything else works fine and I'm finding it hard to trace why it happens...

if there is a force close the stacktrace should 100% show up in logcat. otherwise this is a simple object construction so maybe check the buildpath for the libraries. also try cleaning the project but your code should be working...

Okay, turns out this is related to a known issue with eclipse and mylyn. Moving the mylyn.jar files out of eclipse's plugin folder seems to solve the issue.

(Gson object is being constructed fine and I'm making use of it now...exception was unsupportedexception when i was trying to remove items from an arraylist...odd because this is done several stages before constructing the gson object)

Although this was not entirely the same issue (because there was output in logcat...just wouldn't show anything related to errors/exceptions, and that's in verbose mode and others).

More info: http://groups.google.com/group/android-developers/browse_thread/thread/c64de09595795538/8e577a1e52b26c73?lnk=gst&q=eclipse+19%25#8e577a1e52b26c73

Why doesn't logcat show anything in my Android?

http://code.google.com/p/android/issues/detail?id=1808

Very weird bug, putting the mylyn jars back in the folder and everything works. So the process then:

Open path/to/eclipse/plugin/

cut all *mylyn.jar files

paste them into a temporary folder outside of the eclipse directory.

start/restart eclipse and test that log cat works

All is well? Some feature such as code completion probably isn't working now... Move the mylyn.jar files back to the plugin folder (I'm not sure if it matters whether eclipse is opened or not when you move them back in but it was running when i did it.)

restart eclipse and you should be good to go...

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM