异常装载布局:java.util.LinkedHashMap.eldest()Ljava / UTIL /地图$项;布局、异常、地图、java

2023-09-12 02:05:36 作者:青灯古佛度流年

我试图加载在图形编辑视图中的特定布局文件时得到以下例外。这已经开始后,我下载了最新的 ADT(第20版) SDK API级别16

I'm getting the following exceptions when trying to load a particular layout file in graphical edit view. This has started after I downloaded the latest ADT (Version 20) and SDK API Level 16:

java.lang.NoSuchMethodError: java.util.LinkedHashMap.eldest()Ljava/util/Map$Entry;
at android.util.LruCache.trimToSize(LruCache.java:206)
at android.util.LruCache.evictAll(LruCache.java:306)
at android.widget.SpellChecker.resetSession(SpellChecker.java:141)
at android.widget.SpellChecker.setLocale(SpellChecker.java:147)
at android.widget.SpellChecker.<init>(SpellChecker.java:112)
at android.widget.Editor.updateSpellCheckSpans(Editor.java:461)
at android.widget.Editor.onAttachedToWindow(Editor.java:212)
at android.widget.TextView.onAttachedToWindow(TextView.java:4455)
at android.widget.AutoCompleteTextView.onAttachedToWindow(AutoCompleteTextView.java:1001)
at android.view.View.dispatchAttachedToWindow(View.java:11755)
at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:2424)
at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:2424)
at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:2424)
at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:2424)
at android.view.ViewGroup.dispatchAttachedToWindow(ViewGroup.java:2424)
at android.view.AttachInfo_Accessor.setAttachInfo(AttachInfo_Accessor.java:37)
at com.android.layoutlib.bridge.impl.RenderSessionImpl.inflate(RenderSessionImpl.java:329)
at com.android.layoutlib.bridge.Bridge.createSession(Bridge.java:331)
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:1640)
at com.android.ide.eclipse.adt.internal.editors.layout.gle2.GraphicalEditorPart.recomputeLayout(GraphicalEditorPart.java:1391)
at com.android.ide.eclipse.adt.internal.editors.layout.gle2.GraphicalEditorPart$ConfigListener.onThemeChange(GraphicalEditorPart.java:735)
at com.android.ide.eclipse.adt.internal.editors.layout.configuration.ConfigurationComposite.onThemeChange(ConfigurationComposite.java:2901)
at com.android.ide.eclipse.adt.internal.editors.layout.configuration.SelectThemeAction.run(SelectThemeAction.java:47)
at org.eclipse.jface.action.Action.runWithEvent(Action.java:498)
at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(ActionContributionItem.java:584)
at org.eclipse.jface.action.ActionContributionItem.access$2(ActionContributionItem.java:501)
at org.eclipse.jface.action.ActionContributionItem$5.handleEvent(ActionContributionItem.java:411)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
at org.eclipse.swt.widgets.Display.sendEvent(Display.java:4128)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1457)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1480)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1465)
at org.eclipse.swt.widgets.Widget.notifyListeners(Widget.java:1270)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3974)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3613)
at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2701)
at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2665)
at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2499)
at org.eclipse.ui.internal.Workbench$7.run(Workbench.java:679)
at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:668)
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:597)
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)

更新:

我的工作就是四处切换到API级别15(有一个小下拉了Android图标和API级别)的设计模式。然后,我没有看到这个异常。

My work around was to switch to api level 15 (there's a little drop down with the android icon and api level) in the design mode. Then I don't see this exception.

推荐答案

我有同样的问题(很新,在这里机器人,所以和我一起承担)。我在堆栈跟踪看到它说的错误来自...拼写检查。所以我想,也许,如果我禁用拼写检查我的编辑字段,我可以解决的错误,直到更新到Eclipse的工具。

I was having the same problem (very new to Android here, so bear with me). I see in the StackTrace it says the error comes from ...SpellChecker. So I thought maybe if I disable spell checking on my edit field, that I could work around the error until the update to the eclipse tool.

按照指示在这里:Android冰淇淋三明治EDITTEXT:禁用拼写检查和自动换行我加入

following the instructions here: Android Ice Cream Sandwich Edittext: Disabling Spell Check and Word Wrap I added

    android:inputType="textNoSuggestions"

这解决了我的问题。