Java:异常NoSuchMethodError:没有这样的方法a.()I

发布于 2024-09-15 03:42:43 字数 302 浏览 6 评论 0原文

我正在开发一个 j2me 应用程序 - 它在模拟器和大多数手机上运行良好,但在 2 个诺基亚设备(均在 ARM CPU 中具有 h/w java 加速)上,我在启动 midlet 时遇到此错误:

java/lang/NoSuchMethodError:没有这样的方法a.()I。

禁用混淆器没有帮助。 相同的混淆或非混淆 jar 可以在模拟器和其他手机上正常工作。 我不知道如何调试这个问题以及可能的原因是什么。有什么想法吗?

如果这很重要的话,我正在使用 j2me Polish 框架,但失败发生在我的一个类中(我在禁用混淆器时看到它)。

I'm developing a j2me application - it works fine on emulator and on most phones, but on 2 Nokia devices (both with h/w java acceleration in ARM CPU) I have this error while launching the midlet:

java/lang/NoSuchMethodError: No such method a.()I.

Disabling obfuscator doesn't help.
The same obfuscated or non-obfuscated jar works fine with both emulator and other cell phones.
I have no idea how to debug this problem and what may be the reason. Any ideas?

I'm using j2me Polish framework if that matters, but the fail is in one of my classes (I see it when disabling obfuscator).

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

原野 2024-09-22 03:42:46

NoSuchMethodError 意味着您正在尝试调用不存在的方法(即,应该包含该方法的类已成功加载,但它没有该方法定义)。当您针对某个库进行编译,然后使用该库的不同版本运行时,通常会发生这种情况。当您从代码中删除一个方法,然后无法重新编译使用该方法的类时,也可能会导致这种情况。

A NoSuchMethodError means that you're trying to call a method that doesn't exist (that is, the class which is supposed to contain that method was loaded successfully, but it doesn't have that method definition). It usually happens when you're compiling against some library, then running with a different version of the library. It's also possible to cause it when you remove a method from your code, then fail to re-compile the classes which use this method.

笑咖 2024-09-22 03:42:46

将我的问题的根源添加到 @Mike 的答案中,以防其他人遇到类似的情况:

我有一个 Eclipse 项目,它依赖于另一个项目。这两个项目都依赖于一个公共库,我无意中更新了一个项目的库版本,但没有更新另一个项目的库版本。

To add the source of my problem to @Mike's answer in case anyone else runs into a similar situation:

I have an Eclipse project that has a dependency on another project. Both projects have dependencies to a common library and I had inadvertently updated the library version on one project but not the other.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文