Skip to content Skip to sidebar Skip to footer

Android Sdk Not Compiling Apps Correctly

It seems that the Android SDK doesn't compile my android app correctly. After building an app, I sometimes get seemingly random exceptions. The error goes away if I comment out the

Solution 1:

Commenting out this code, rebuilding, uncommenting and rebuilding, makes the error go away.

This might seem to you like a bug in Android, but I suspect that the real problem is a threading / synchronization related bug in your code. For instance, playButton may be being used before it is initialized.

But we cannot really help you unless you show us the stack trace and identify the line(s) of code where the exception was thrown.


However, if it is indeed buggy programming, why is the app running fine now w/o ANY errors at all?

See above: it is most likely because you have a threading / synchronization issue. You need to be aware that different parts of an application with a GUI will run in different threads ... even if you didn't explicitly create those threads. There are rules you have to follow. If you don't follow those rules, bad things happen ... like exceptions that sometimes happen and sometimes don't happen, depending on which way the wind is blowing.

Solution 2:

Could be that your PLAY_GAME activity is returning without a result, e.g., if you press the back button & it just stops without calling setResult().

Solution 3:

No, as noted in several other places, sometimes the source and the bin get out of sync. I've noticed numerous times, specially when making changes to XML. The solution, for commandline users, is to remove the bin directory, and re-compile. Problem goes away.

Post a Comment for "Android Sdk Not Compiling Apps Correctly"