31

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)

UPDATE:

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.

Code Poet
  • 11,227
  • 19
  • 64
  • 97
  • That's its better to backup all the things before updating, I know there is defiantly solution available but Time is important factor. – rajpara Jun 30 '12 at 16:37

1 Answers1

71

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.

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

    android:inputType="textNoSuggestions"

This solved the problem for me.

Community
  • 1
  • 1
Michael
  • 2,973
  • 1
  • 27
  • 67
  • 7
    This works for me too. However, I hope we get an update soon. I want my edit field to have text suggestions. 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. I'm giving this to you though :) – Code Poet Jul 01 '12 at 03:41
  • This solved the problem for me, too. New to Android to development. –  Jul 02 '12 at 22:13
  • 3
    I've published your solution on my blog (with credits of course) including some screenshots to see exactly how to fix it : http://android.foxykeep.com/dev/small-issue-with-adt-20-and-sdk-16-and-how-to-fix-it – Foxykeep Jul 06 '12 at 06:11
  • 4
    This is a known issue. Progress on the solution can be followed [in the tracker](http://code.google.com/p/android/issues/detail?id=33789). – Fernando Correia Jul 17 '12 at 17:56