Android requires .class compatibility

Among new iOS developers, the awfulness of XCode is a well-accepted fact. I get it: for anyone coming over from Visual Studio, it can be a rough ride. It’s like switching from a Range Rover (immaculately detailed, perfectly climate controlled, exquisite sound system) to a beat-up old jeep (cloth top open, doors off, windshield down). It’s a rougher ride, but there are places you’ll take that jeep you would never dare drive the Range Rover, and you’ll be better off for it.

I was thinking about common developer complaints about XCode today when doing a little Android work. I grabbed the latest code to one of our Android projects today, opened it in Eclipse, and tried to build it. It failed with the following reason:

Android requires .class compatibility set to 5.0. Please fix project properties.

If you open the project properties and dig through every pane, sub-pane, and sub-sub pane, you’ll never find an option for “.class compatibility.”

Obtuse error messages? Inadequate instructions? Just like XCode!

But to be fair, XCode has gotten tremendously better in recent releases. Error messages are greatly improved. Common errors are found and fixed for you. The current release will even automatically connect to the Provisioning Portal and manage devices and profiles for you. Without a doubt the biggest impediment to developers learning the iOS platform is dealing with certificates and profiles, and XCode just made it automatic. Nowadays most complaints about XCode are really just veiled complaints about gdb, objective-c syntax, or Macs in general.

Anyway, back to Android. What’s the fix? Don’t actually try to fix the project properties yourself. Right-click on the project name in the project explorer and, in that stupidly long menu, go to the 28th item (seriously, I counted them, it’s 28 not counting the separators) called “Android Tools,” and in the submenu, go to the last item called, appropriately enough, “Fix Project Properties.”

I love driving jeeps. I love the wind stinging my eyes and bugs getting stuck in my hair. But even I have limits. Hey, Android Development Tools: would it kill you to maybe execute that yourself if you see that it needs to be done?

This entry was posted on Thursday, July 22nd, 2010 at 5:54 am and is filed under Uncategorized. You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.

One Response to “Android requires .class compatibility”

  1. Mel Stanley

    The setting that controls the class compatibility level in Eclipse is actually available under Project->Properties, in the Java Compiler section. The line item is ‘Compiler Compliance Level’. It’s a little confusing though because the error message says 5.0 but that actually means setting the compliance level to 1.5.

    For what it’s worth I find Eclipse far more awful than Xcode in just about every way. I can’t believe anyone prefers it to Netbeans. But if you’re doing Android you don’t have much choice.

Leave a Reply

Your comment