Exception java.lang.NoSuchMethodError on java.util.Deque.push

混江龙づ霸主 提交于 2019-12-06 14:18:02

问题


It's really strange, Google Developer Console, error reporting page.

As it seems, my application crashes on several Android devices. The exception log provided says:

java.lang.NoSuchMethodError: java.util.Deque.push
at com.larvalabs.svgandroid.SVGParser$SVGHandler.<init>(SVGParser.java:869)
at com.larvalabs.svgandroid.SVGBuilder.build(SVGBuilder.java:147)
at myapp.graphic.PictureCache.getSvgPicture(PictureCache.java:59)
at myapp.graphic.PictureCache.getSvgPictureDrawable(PictureCache.java:65)
at myapp.activities.startup.ActivityStartup.setupCustomGraphic(ActivityStartup.java:92)
at myapp.activities.startup.ActivityStartup.onCreate(ActivityStartup.java:35)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1069)
...

I'm using that library:

http://code.google.com/p/svg-android-2/

I included the source cod, not simply linked the external library.

The code seems to fail on java.util.Deque.push (NoSuchMethodError). It's not a problem of the source code I've copied and pasted, it seems that no dequeue method is found on runtime! How it's possible? Can't imagine.

EDIT: The Deque is define:

Deque<Matrix> matrixStack = new LinkedList<Matrix>();

The code that raise the problem:

matrixStack.push(new Matrix());

Is it possible that new Matrix() returns a value that is not accepted by the push() method?


回答1:


Your project references java.util.Deque which was only added in API level 9

(http://developer.android.com/reference/java/util/Deque.html)

Devices with API level < 9 will fail as they cannot call this Class/method as it doesn't exist on them.



来源:https://stackoverflow.com/questions/16988593/exception-java-lang-nosuchmethoderror-on-java-util-deque-push

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!