Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Failed to create the part's controls

I get a null pointer exception opening about half of the android XML files in my layout directory. There seems to be no pattern to why some files open and some files don't.

I upgraded eclipse to Juno. Re-installed all the plugins (ADT), re-installed the android SDK. I brought in my old workspace and adjusted my projects to point at the new android SDK.

Stack

java.lang.NullPointerException at com.android.ide.eclipse.adt.internal.editors.layout.configuration.ConfigurationComposite.setLocaleCombo(ConfigurationComposite.java:1566) at com.android.ide.eclipse.adt.internal.editors.layout.configuration.ConfigurationComposite.syncRenderState(ConfigurationComposite.java:3049) at com.android.ide.eclipse.adt.internal.editors.layout.gle2.GraphicalEditorPart.activated(GraphicalEditorPart.java:1158) at com.android.ide.eclipse.adt.internal.editors.layout.LayoutEditorDelegate.delegatePageChange(LayoutEditorDelegate.java:679) at com.android.ide.eclipse.adt.internal.editors.common.CommonXmlEditor.pageChange(CommonXmlEditor.java:359) at org.eclipse.ui.part.MultiPageEditorPart.setActivePage(MultiPageEditorPart.java:1081) at org.eclipse.ui.forms.editor.FormEditor.setActivePage(FormEditor.java:607)

like image 432
Johnny Z Avatar asked Oct 28 '12 21:10

Johnny Z


2 Answers

I found one way to resolve this. My eclipse recently crashed (and wouldn't start again) for an unrelated reason. To get it to start again I deleted most of the files in ${workspace}/.metadata/.plugins. These files regenerate (but will wipe some of your saved plugins and settings). Resolved my startup problem and my xml editor problem.

like image 196
Johnny Z Avatar answered Oct 19 '22 09:10

Johnny Z


Just close all the xml files and restart your Eclipse SDK

like image 32
Ankit Vyas Avatar answered Oct 19 '22 09:10

Ankit Vyas