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...
-
1It shouldn't die without spitting something out to logcat. Are you saying that there's no exception logged or that you cannot see logcat at all? – Haphazard May 19 '11 at 13:09
-
there's no exception. Log cat is there...just nothing about why it dies – zcourts May 20 '11 at 19:17
2 Answers
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...

- 15,880
- 12
- 60
- 88
-
Nope, no stack trace. I've checked,double checked and triple checked the build path...nada! I'm setting up dev env. on windows now to see if i get the same problem. There is a force close on the phone and emulator when i use my update button to fetch data from the server... loading dialog shows as expected as it goes off the force close comes up – zcourts May 20 '11 at 19:20
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).
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...