开发者

Errors with ADT/Graphical Layout

开发者 https://www.devze.com 2023-03-13 18:55 出处:网络
I\'m trying to view my layout in the Graphical Layout display and when I do I see a nullpointerexception and an error that layout.xml: NoClassDefFoundError: Could not initialize class android.widget.T

I'm trying to view my layout in the Graphical Layout display and when I do I see a nullpointerexception and an error that layout.xml: NoClassDefFoundError: Could not initialize class android.widget.TextView and another error like this:

    java.lang.NullPointerException
at android.graphics.Paint.measureText(Paint.java:801)
at android.graphics.Paint.measureText(Paint.java:874)
at android.widget.TextView.<clinit>(TextView.java:292)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
at android.view.LayoutInflater.createView(LayoutInflater.java:500)
at android.view.BridgeInflater.onCreateView(BridgeInflater.java:77)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:563)
at android.view.BridgeInflater.createViewFromTag(BridgeInflater.java:122)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:618)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:621)
at android.view.LayoutInflater.inflate(LayoutInflater.java:407)
at android.view.LayoutInflater.inflate(LayoutInflater.java:296)
at com.android.layoutlib.bridge.Bridge.computeLayout(Bridge.java:397)
at com.android.ide.common.rendering.LayoutLibrary.createLegacySession(LayoutLibrary.java:492)
at com.android.ide.common.rendering.LayoutLibrary.createSession(LayoutLibrary.java:337)
at com.android.ide.eclipse.adt.internal.editors.layout.gle2.GraphicalEditorPart.renderWithBridge(GraphicalEditorPart.java:1510)
at com.android.ide.eclipse.adt.internal.editors.layout.gle2.GraphicalEditorPart.renderWithBridge(GraphicalEditorPart.java:1347)
at com.android.ide.eclipse.adt.internal.editors.layout.gle2.GraphicalEditorPart.recomputeLayout(GraphicalEditorPart.java:1078)
at com.android.ide.eclipse.adt.internal.editors.layout.gle2.GraphicalEditorPart$ConfigListener.onConfigurationChange(GraphicalEditorPart.java:500)
at com.android.ide.eclipse.adt.internal.editors.layout.gle2.GraphicalEditorPart.onTargetChange(GraphicalEditorPart.java:980)
at com.android.ide.eclipse.adt.internal.editors.layout.LayoutEditor.onDescriptorsChanged(LayoutEditor.java:587)
at com.android.ide.eclipse.adt.internal.editors.layout.LayoutEditor.initUiRootNode(LayoutEditor.java:509)
at com.android.ide.eclipse.adt.internal.editors.layout.gle2.GraphicalEditorPart$TargetListener.updateEditor(GraphicalEditorPart.java:794)
at com.android.ide.eclipse.adt.internal.editors.layout.gle2.GraphicalEditorPart$TargetListener.onTargetLoaded(GraphicalEditorPart.java:759)
at com.android.ide.eclipse.adt.AdtPlugin$13.run(AdtPlugin.java:1651)
at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35)
at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:134)
at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:3593)
at org.eclipse.swt.widgets.Display.observerProc(Display.java:3234)
at org.eclipse.swt.internal.cocoa.OS.objc_msgSendSuper(Native Method)
at org.eclipse.swt.widgets.Widget.callSuper(Widget.java:220)
at org.eclipse.swt.widgets.Widget.mouseDownSuper(Widget.java:1025)
at org.eclipse.swt.widgets.Widget.mouseDown(Widget.java:1021)
at org.eclipse.swt.widgets.Control.mouseDown(Control.java:2263)
at org.eclipse.swt.widgets.Combo.mouseDown(Combo.java:981)
at org.eclipse.swt.widgets.Display.windowProc(Display.java:4983)
at org.eclipse.swt.internal.cocoa.OS.objc_msgSendSuper(Native Method)
at org.eclipse.swt.widgets.Widget.callSuper(Widget.java:220)
at org.eclipse.swt.widgets.Widget.windowSendEvent(Widget.java:1959)
at org.eclipse.swt.widgets.Shell.windowSendEvent(Shell.java:2025)
at org.eclipse.swt.widgets.Display.windowProc(Display.java:5047)
at org.eclipse.swt.internal.cocoa.OS.objc_msgSendSuper(Native Method)
at org.eclipse.swt.widgets.Display.applicationSendEvent(Display.java:4589)
at org.eclipse.swt.widgets.Display.applicationProc(Display.java:4666)
at org.eclipse.swt.internal.cocoa.OS.objc_msgSend(Native Method)
at org.eclipse.swt.internal.cocoa.NSApplication.sendEvent(NSApplication.java:115)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3281)
at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2640)
at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2604)
at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2438)
at org.eclipse.ui.internal.Workbench$7.run(Workbench.java:671)
at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:664)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:115)
at org.ecli开发者_如何学编程pse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:369)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:620)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:575)
at org.eclipse.equinox.launcher.Main.run(Main.java:1408)

What can I do to fix this?


I have faced problem related to this not exactly this but something related

so you should re-install your jdk and jre in your system and then run eclipse, if the same not resolved then try to re-install eclipse again because some times the plug in files are corrupted due to any reason

so you should try this


Nothing worked so I just installed MotoDev and it all works now.

0

精彩评论

暂无评论...
验证码 换一张
取 消