很长一段时间,我的Eclipse环境与Android插件运行顺利。在软件更新过程中应用的更新行的某个地方它已经崩溃了。开始发生的第一个问题是在为布局文件运行Android插件图形编辑器时丢失了“按钮”Form Widget图形。我在错误日志中收到以下相关错误:
!MESSAGE voice_recog.xml: android.webkit.WebView
!MESSAGE main_new.xml: Failed lot load /Developer/android-sdk-mac_x86-1.5_r3/platforms/android-11/data/res/drawable-hdpi/btn_default_normal.9.png
!STACK 0
javax.imageio.IIOException: Error reading PNG metadata
我将png文件放在我的硬盘上并从Finder启动了图像查看器。它显示没有错误。我不知道为什么IDE无法将其加载到图形编辑器中。如果您查看帖子末尾的详细错误日志转储,您将看到发生的异常是 java.io.EOFException (“由此引起:java.io.EOFException”)。 / p>
我注意到其中一个更新在我的硬盘上安装了Android-12,并且IDE正在寻找Android-11目录中的PNG。但是正如我之前所说,该文件确实存在于错误消息中显示的Android-11路径中。我只是指出这一点,以防它可能表明我的设置中存在其他一些问题。
注意:我尝试将图形布局编辑器切换到不同的设备,从“3.7英寸WVGA”切换到其他几个,我得到的PNG文件加载错误比以前更多(更多),还有ClassCast异常。我也尝试将Android平台从3.0切换到我的目标1.6,这也没有帮助。就好像现在有一些PNG文件加载代码破坏了。我希望不要完全重新安装Eclipse和ADT,特别是因为我最终可以回到同一个故障点,所以如果有人遇到这些问题并解决了它们,请回复。
以下是PNG文件原始失败加载的完整错误日志跟踪:
!ENTRY com.android.ide.eclipse.adt 4 0 2011-06-23 04:07:39.972
!MESSAGE web2voice_main_new.xml: Failed lot load /Developer/android-sdk-mac_x86-1.5_r3/platforms/android-11/data/res/drawable-hdpi/btn_default_normal.9.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:1322)
at com.android.ninepatch.GraphicsUtilities.loadCompatibleImage(GraphicsUtilities.java:37)
at com.android.ninepatch.NinePatch.load(NinePatch.java:96)
at com.android.layoutlib.bridge.impl.ResourceHelper.getNinePatchDrawable(ResourceHelper.java:279)
at com.android.layoutlib.bridge.impl.ResourceHelper.getDrawable(ResourceHelper.java:190)
at com.android.layoutlib.bridge.android.BridgeResources.getDrawable(BridgeResources.java:162)
at android.graphics.drawable.StateListDrawable.inflate(StateListDrawable.java:173)
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:214)
at com.android.layoutlib.bridge.android.BridgeTypedArray.getDrawable(BridgeTypedArray.java:693)
at android.view.View.<init>(View.java:2471)
at android.widget.TextView.<init>(TextView.java:368)
at android.widget.Button.<init>(Button.java:108)
at android.widget.Button.<init>(Button.java:104)
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:83)
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:128)
at android.view.LayoutInflater_Delegate.rInflate(LayoutInflater_Delegate.java:76)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:702)
at android.view.LayoutInflater_Delegate.rInflate(LayoutInflater_Delegate.java:79)
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:315)
at com.android.layoutlib.bridge.Bridge.createSession(Bridge.java:314)
at com.android.ide.common.rendering.LayoutLibrary.createSession(LayoutLibrary.java:324)
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.activated(GraphicalEditorPart.java:904)
at com.android.ide.eclipse.adt.internal.editors.layout.LayoutEditor.pageChange(LayoutEditor.java:403)
at org.eclipse.ui.part.MultiPageEditorPart$2.widgetSelected(MultiPageEditorPart.java:290)
at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:234)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
at org.eclipse.swt.widgets.Display.sendEvent(Display.java:3783)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1375)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1398)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1383)
at org.eclipse.swt.widgets.Widget.notifyListeners(Widget.java:1195)
at org.eclipse.swt.custom.CTabFolder.setSelection(CTabFolder.java:2743)
at org.eclipse.swt.custom.CTabFolder.onMouse(CTabFolder.java:1429)
at org.eclipse.swt.custom.CTabFolder$1.handleEvent(CTabFolder.java:257)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
at org.eclipse.swt.widgets.Display.sendEvent(Display.java:3783)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1375)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1398)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1383)
at org.eclipse.swt.widgets.Widget.notifyListeners(Widget.java:1195)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3629)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3284)
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.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: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:592)
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)
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)
... 80 more
- roschler
答案 0 :(得分:2)
我通过在图形布局框的右上角从Android 3.0中取出Eclipse来解决这个问题。我将版本下载到Android 2.3.3,一旦完成加载这个版本,我就明白了。 “按钮”png加载得很好。