Monday, November 1, 2010

Android development

After a long time not using Eclipse, I recently started it again to experiment further with Android development. 3 things came up, which I would like to share with you and what the fix is.

image

 

After creating a test Android project, the following error showed up:

ERROR: Unable to open class file <path>\gen\com\example\test\R.java: No such file or directory.

It seems that the java compiler cannot create this R.java. In order to fix this, do the following:

  1. Open Eclipse
  2. Open Window/Preferences
  3. Expand JAVA option
  4. Select Build Path
  5. Check the option "Project" and uncheck "folder" options
  6. Click on OK
  7. Restart eclipse IDE

These steps fixed my problems regarding this issue.

 

image

 

When trying to run the application, the following error came up:

An internal error occurred during: "Launching test".com/android/ddmlib/ShellCommandUnresponsiveException

The fix for this was to update the Android DDMS by going to Help -> Software Updates select the Android DDMS and press Update button.

I had updated the Android Development tools, but had forgotten to update the Android DDMS.

 

image

 

Unable to view manifest files from within Eclipse, when you open the main.xml

When you try to open an application's manifest file from within Eclipse, you might get an error such as this one:

An error has occurred. See error log for more details.
org.eclipse.wst.sse.ui.StructuredTextEditor.isBlockSelectionModeEnabled()Z

Try reverting to the 3.0 version of the Eclipse XML Editors and Tools. If this does not work, remove the 3.1 version of the tool. To do this in Eclipse 3.4:

  1. Select Help > Software Updates...
  2. Select the Installed Software tab.
  3. Select Eclipse XML Editors and Tools.
  4. Click Uninstall.
  5. Click Finish.
  6. When you restart Eclipse, you should be able to view the manifest files.

In my case, I just uninstalled them and it magically worked Smile

 

Hope these were useful for you if you encounter the same issue.

No comments: