其他分享
首页 > 其他分享> > 添加ListFragment时,Android Layout Designer无法加载平台的可绘制资源

添加ListFragment时,Android Layout Designer无法加载平台的可绘制资源

作者:互联网

我在64位Windows 7上使用Eclipse.在Android布局设计器的“图形布局”选项卡中将ListFragment添加到布局中时,出现以下消息:

Failed lot load C:\PROGRA~2\Android\android-sdk\platforms\android-11\data\res\drawable-mdpi\spinner_76_outer_holo.png
Failed to parse file C:\PROGRA~2\Android\android-sdk\platforms\android-11\data\res\drawable\progress_large_holo.xml
Failed lot load C:\PROGRA~2\Android\android-sdk\platforms\android-11\data\res\drawable-mdpi\list_pressed_holo_dark.9.png
Failed to parse file C:\PROGRA~2\Android\android-sdk\platforms\android-11\data\res\drawable\list_selector_background_transition_holo_dark.xml
Failed to parse file C:\PROGRA~2\Android\android-sdk\platforms\android-11\data\res\drawable\list_selector_holo_dark.xml
Failed lot load C:\PROGRA~2\Android\android-sdk\platforms\android-11\data\res\drawable-mdpi\list_divider_holo_dark.9.png
Exception details are logged in Window > Show View > Error Log

这就是错误日志的内容,我只粘贴了它的第一部分,因为它很长(尽管我已经清理了旧的日志):

!ENTRY com.android.ide.eclipse.adt 4 0 2012-01-24 02:58:17.134
!MESSAGE company.xml: Failed lot load C:\PROGRA~2\Android\android-sdk\platforms\android-11\data\res\drawable-mdpi\spinner_76_outer_holo.png
!STACK 0
javax.imageio.IIOException: Error reading PNG metadata
    at com.sun.imageio.plugins.png.PNGImageReader.readMetadata(PNGImageReader.java:695)
    at com.sun.imageio.plugins.png.PNGImageReader.readImage(PNGImageReader.java:1314)
    at com.sun.imageio.plugins.png.PNGImageReader.read(PNGImageReader.java:1601)
    at javax.imageio.ImageIO.read(ImageIO.java:1400)
    at javax.imageio.ImageIO.read(ImageIO.java:1286)
    at android.graphics.Bitmap_Delegate.createBitmap(Bitmap_Delegate.java:97)
    at com.android.layoutlib.bridge.impl.ResourceHelper.getDrawable(ResourceHelper.java:233)
    at com.android.layoutlib.bridge.android.BridgeResources.getDrawable(BridgeResources.java:167)
    at android.graphics.drawable.RotateDrawable.inflate(RotateDrawable.java:242)
    at android.graphics.drawable.Drawable.createFromXmlInner(Drawable.java:832)
    at android.graphics.drawable.LayerDrawable.inflate(LayerDrawable.java:165)
    at android.graphics.drawable.Drawable.createFromXmlInner(Drawable.java:832)
    at android.graphics.drawable.Drawable.createFromXml(Drawable.java:769)
    at com.android.layoutlib.bridge.impl.ResourceHelper.getDrawable(ResourceHelper.java:208)
    at com.android.layoutlib.bridge.android.BridgeTypedArray.getDrawable(BridgeTypedArray.java:775)
    at android.widget.ProgressBar.<init>(ProgressBar.java:282)
    at android.widget.ProgressBar.<init>(ProgressBar.java:234)
    at android.widget.ProgressBar.<init>(ProgressBar.java:230)
    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:501)
    at android.view.LayoutInflater.createView(LayoutInflater.java:576)
    at com.android.layoutlib.bridge.android.BridgeInflater.onCreateView(BridgeInflater.java:84)
    at android.view.LayoutInflater.onCreateView(LayoutInflater.java:644)
    at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:669)
    at com.android.layoutlib.bridge.android.BridgeInflater.createViewFromTag(BridgeInflater.java:129)
    at android.view.LayoutInflater_Delegate.rInflate(LayoutInflater_Delegate.java:83)
    at android.view.LayoutInflater.rInflate(LayoutInflater.java:702)
    at android.view.LayoutInflater_Delegate.rInflate(LayoutInflater_Delegate.java:86)
    at android.view.LayoutInflater.rInflate(LayoutInflater.java:702)
    at android.view.LayoutInflater.inflate(LayoutInflater.java:479)
    at android.view.LayoutInflater.inflate(LayoutInflater.java:391)
    at android.app.ListFragment.onCreateView(ListFragment.java:193)
    at android.app.FragmentManagerImpl.moveToState(FragmentManager.java:708)
    at android.app.FragmentManagerImpl.moveToState(FragmentManager.java:900)
    at android.app.FragmentManagerImpl.addFragment(FragmentManager.java:978)
    at android.app.Activity.onCreateView(Activity.java:4090)
    at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:659)
    at com.android.layoutlib.bridge.android.BridgeInflater.createViewFromTag(BridgeInflater.java:129)
    at android.view.LayoutInflater_Delegate.rInflate(LayoutInflater_Delegate.java:83)
    at android.view.LayoutInflater.rInflate(LayoutInflater.java:702)
    at android.view.LayoutInflater.inflate(LayoutInflater.java:479)
    at android.view.LayoutInflater.inflate(LayoutInflater.java:367)
    at com.android.layoutlib.bridge.impl.RenderSessionImpl.inflate(RenderSessionImpl.java:324)
    at com.android.layoutlib.bridge.Bridge.createSession(Bridge.java:321)
    at com.android.ide.common.rendering.LayoutLibrary.createSession(LayoutLibrary.java:325)
    at com.android.ide.eclipse.adt.internal.editors.layout.gle2.RenderService.createRenderSession(RenderService.java:372)
    at com.android.ide.eclipse.adt.internal.editors.layout.gle2.GraphicalEditorPart.renderWithBridge(GraphicalEditorPart.java:1323)
    at com.android.ide.eclipse.adt.internal.editors.layout.gle2.GraphicalEditorPart.recomputeLayout(GraphicalEditorPart.java:1077)
    at com.android.ide.eclipse.adt.internal.editors.layout.gle2.GraphicalEditorPart.activated(GraphicalEditorPart.java:903)
    at com.android.ide.eclipse.adt.internal.editors.layout.LayoutEditor.pageChange(LayoutEditor.java:399)
    at org.eclipse.ui.part.MultiPageEditorPart.setActivePage(MultiPageEditorPart.java:1067)
    at org.eclipse.ui.forms.editor.FormEditor.setActivePage(FormEditor.java:607)
    at com.android.ide.eclipse.adt.internal.editors.AndroidXmlEditor.selectDefaultPage(AndroidXmlEditor.java:381)
    at com.android.ide.eclipse.adt.internal.editors.AndroidXmlEditor.addPages(AndroidXmlEditor.java:286)
    at org.eclipse.ui.forms.editor.FormEditor.createPages(FormEditor.java:138)
    at org.eclipse.ui.part.MultiPageEditorPart.createPartControl(MultiPageEditorPart.java:348)
    at org.eclipse.ui.internal.EditorReference.createPartHelper(EditorReference.java:670)
    at org.eclipse.ui.internal.EditorReference.createPart(EditorReference.java:465)
    at org.eclipse.ui.internal.WorkbenchPartReference.getPart(WorkbenchPartReference.java:595)
    at org.eclipse.ui.internal.EditorReference.getEditor(EditorReference.java:289)
    at org.eclipse.ui.internal.WorkbenchPage.busyOpenEditorBatched(WorkbenchPage.java:2945)
    at org.eclipse.ui.internal.WorkbenchPage.busyOpenEditor(WorkbenchPage.java:2850)
    at org.eclipse.ui.internal.WorkbenchPage.access$11(WorkbenchPage.java:2842)
    at org.eclipse.ui.internal.WorkbenchPage$10.run(WorkbenchPage.java:2793)
    at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:70)
    at org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPage.java:2789)
    at org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPage.java:2773)
    at org.eclipse.ui.internal.WorkbenchPage.openEditor(WorkbenchPage.java:2764)
    at org.eclipse.ui.ide.IDE.openEditor(IDE.java:651)
    at org.eclipse.ui.ide.IDE.openEditor(IDE.java:610)
    at org.eclipse.jdt.internal.ui.javaeditor.EditorUtility.openInEditor(EditorUtility.java:355)
    at org.eclipse.jdt.internal.ui.javaeditor.EditorUtility.openInEditor(EditorUtility.java:164)
    at org.eclipse.jdt.ui.actions.OpenAction.run(OpenAction.java:249)
    at org.eclipse.jdt.ui.actions.OpenAction.run(OpenAction.java:228)
    at org.eclipse.jdt.ui.actions.SelectionDispatchAction.dispatchRun(SelectionDispatchAction.java:275)
    at org.eclipse.jdt.ui.actions.SelectionDispatchAction.run(SelectionDispatchAction.java:251)
    at org.eclipse.jdt.internal.ui.packageview.PackageExplorerActionGroup.handleOpen(PackageExplorerActionGroup.java:376)
    at org.eclipse.jdt.internal.ui.packageview.PackageExplorerPart$4.open(PackageExplorerPart.java:538)
    at org.eclipse.ui.OpenAndLinkWithEditorHelper$InternalListener.open(OpenAndLinkWithEditorHelper.java:48)
    at org.eclipse.jface.viewers.StructuredViewer$2.run(StructuredViewer.java:866)
    at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
    at org.eclipse.ui.internal.JFaceUtil$1.run(JFaceUtil.java:49)
    at org.eclipse.jface.util.SafeRunnable.run(SafeRunnable.java:175)
    at org.eclipse.jface.viewers.StructuredViewer.fireOpen(StructuredViewer.java:864)
    at org.eclipse.jface.viewers.StructuredViewer.handleOpen(StructuredViewer.java:1152)
    at org.eclipse.jface.viewers.StructuredViewer$6.handleOpen(StructuredViewer.java:1256)
    at org.eclipse.jface.util.OpenStrategy.fireOpenEvent(OpenStrategy.java:275)
    at org.eclipse.jface.util.OpenStrategy.access$2(OpenStrategy.java:269)
    at org.eclipse.jface.util.OpenStrategy$1.handleEvent(OpenStrategy.java:309)
    at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
    at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1053)
    at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4165)
    at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3754)
    at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2696)
    at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2660)
    at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2494)
    at org.eclipse.ui.internal.Workbench$7.run(Workbench.java:674)
    at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
    at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:667)
    at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
    at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:123)
    at org.eclipse.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:344)
    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:592)
    at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:622)
    at org.eclipse.equinox.launcher.Main.basicRun(Main.java:577)
    at org.eclipse.equinox.launcher.Main.run(Main.java:1410)
    at org.eclipse.equinox.launcher.Main.main(Main.java:1386)
Caused by: java.io.EOFException
    at javax.imageio.stream.ImageInputStreamImpl.readFully(ImageInputStreamImpl.java:330)
    at java.io.DataInputStream.readUTF(DataInputStream.java:565)
    at javax.imageio.stream.ImageInputStreamImpl.readUTF(ImageInputStreamImpl.java:309)
    at com.sun.imageio.plugins.png.PNGImageReader.parse_iTXt_chunk(PNGImageReader.java:443)
    at com.sun.imageio.plugins.png.PNGImageReader.readMetadata(PNGImageReader.java:652)
    ... 115 more

解决方法:

解决方案很简单.我安装了另一个JRE(JRE 7),并运行了Eclipse.现在,它可以完美运行.

标签:eclipse-adt,eclipse,android
来源: https://codeday.me/bug/20191201/2083750.html