I have recently installed Eclipse IDE for Java Developers (Version: 3.6.1) with the Android SDK Platform 2.1update1 - on Windows 7.
I can add, edit and run code for projects, however, in the Workbench area the Graphical Layout view of the layout xml files always shows a "missing theme" message in bottom right navigation area.The left Palette navigator area is ok and the remaining area is blank.
The error message reads: "Selecting page '0' in AndroidXmlEditor failed"
The first and last 10 lines from the Exception Stack Trace reads:
java.lang.NullPointerException
at com.android.ide.eclipse.adt.internal.editors.layout.gle2.Gra phicalEditorPart.renderWithBridge(Unknown Source)
at com.android.ide.eclipse.adt.internal.editors.layout.gle2.Gra phicalEditorPart.recomputeLayout(Unknown Source)
at com.android.ide.eclipse.adt.internal.editors.layout.gle2.Gra phicalEditorPart.activated(Unknown Source)
at com.android.ide.eclipse.adt.internal.editors.layout.LayoutEd itor.pageChange(Unknown Source)
at org.eclipse.ui.part.MultiPageEditorPart.setActivePage(MultiP ageEditorPart.java:1067)
at org.eclipse.ui.forms.editor.FormEditor.setActivePage(FormEdi tor.java:607)
at com.android.ide.eclipse.adt.internal.editors.AndroidXmlEdito r.selectDefaultPage(Unknown Source)
at com.android.ide.eclipse.adt.internal.editors.AndroidXmlEdito r.addPages(Unknown Source)
at org.eclipse.ui.forms.editor.FormEditor.createPages(FormEdito r.java:138)
at org.eclipse.ui.part.MultiPageEditorPart.createPartControl(Mu ltiPageEditorPart.java:348)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher .start(EclipseAppLauncher.java:79)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:369)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:179)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java: 619)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:574)
at org.eclipse.equinox.launcher.Main.run(Main.java:1407)
Thanks for your help in advance.
In the "Graphical Layout" tab of the layout editor there is a dropdown for selecting the Android version to use. In your case it is probably blank, so select a version and you're probably good to go.
You just select theme on top. above You can see your xml design on my image:
I had the same issue. I solved it by adding a theme attribute to the Android manifest file. I needed a single theme for all the Activities hence I added the attribute at Application level as follows.
`<application android:icon="@drawable/icon"
android:label="@string/app_name"
android:theme="@android:style/Theme.Black">`
Then I closed my Activity UI xml file and re-opened it..and the problem was fixed.
I had this problem with a few brand new projects, with no code added yet. Eclipse apparently defaults to using the highest android sdk installed for the layout editor, even if you specify a different version during creation for the minsdk. Project...Clean... rebuilt it and then it was fine.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With