Android 在不同 API 上进行测试,未找到类

发布于 2024-11-19 05:34:01 字数 1418 浏览 4 评论 0原文

我正在不同的 API 和屏幕分辨率上测试我的应用程序,并在使用 Android 2.1 时遇到了问题。每当我运行该应用程序时,主菜单都会与我为其制作的所有其他活动一起工作,除了一个:主游戏活动。我相信这是因为下面显示的第一个错误。我猜测 Android 2.1 不支持 SoundPool 的 OnLoadCompleteListener。我正在努力寻找替代方案,以便它可以在 2.2 及更高版本和 2.1 及更低版本的 Android 上运行。我非常确定在 2.2 及更高版本中使用 SoundPool 时需要 OnLoadCompleteListener 方法。我记得没有它它就无法工作。有人有建议吗?

谢谢

07-10 15:48:28.685: INFO/dalvikvm(363): Failed resolving Lorg/chinesetones/teacher/Game; interface 8 'Landroid/media/SoundPool$OnLoadCompleteListener;'

07-10 15:48:28.685: WARN/dalvikvm(363): Link of class 'Lorg/chinesetones/teacher/Game;' failed
07-10 15:48:28.685: ERROR/dalvikvm(363): Could not find class 'org.chinesetones.teacher.Game', referenced from method org.chinesetones.teacher.ChineseToneTeacherActivity.onClick
07-10 15:48:28.685: WARN/dalvikvm(363): VFY: unable to resolve const-class 38 (Lorg/chinesetones/teacher/Game;) in Lorg/chinesetones/teacher/ChineseToneTeacherActivity;

07-10 15:49:42.004: ERROR/AndroidRuntime(363): Uncaught handler: thread main exiting due to uncaught exception

07-10 15:49:42.074: ERROR/AndroidRuntime(363): java.lang.NoClassDefFoundError: org.chinesetones.teacher.Game

07-10 15:49:42.074: ERROR/AndroidRuntime(363):     at 
org.chinesetones.teacher.ChineseToneTeacherActivity.onClick(ChineseToneTeacherActivity.java:41)

07-10 15:49:42.074: ERROR/AndroidRuntime(363):     at android.view.View.performClick(View.java:2364)

I'm testing my app on different APIs and screen resolutions and ran into a problem using Android 2.1. Whenever I run the app, the main menu works along with all the other activities I made for it, except for one: the main game activity. I believe it's because the first error shown below. I'm guessing Android 2.1 doesn't support the SoundPool's OnLoadCompleteListener. I'm struggling to figure out an alternative to this so it works on both 2.2 and higher and 2.1 and lower Android versions. I'm pretty sure the OnLoadCompleteListener method is required when using SoundPool in 2.2 and above. I remember it not working without it. Anyone have suggestions?

Thanks

07-10 15:48:28.685: INFO/dalvikvm(363): Failed resolving Lorg/chinesetones/teacher/Game; interface 8 'Landroid/media/SoundPool$OnLoadCompleteListener;'

07-10 15:48:28.685: WARN/dalvikvm(363): Link of class 'Lorg/chinesetones/teacher/Game;' failed
07-10 15:48:28.685: ERROR/dalvikvm(363): Could not find class 'org.chinesetones.teacher.Game', referenced from method org.chinesetones.teacher.ChineseToneTeacherActivity.onClick
07-10 15:48:28.685: WARN/dalvikvm(363): VFY: unable to resolve const-class 38 (Lorg/chinesetones/teacher/Game;) in Lorg/chinesetones/teacher/ChineseToneTeacherActivity;

07-10 15:49:42.004: ERROR/AndroidRuntime(363): Uncaught handler: thread main exiting due to uncaught exception

07-10 15:49:42.074: ERROR/AndroidRuntime(363): java.lang.NoClassDefFoundError: org.chinesetones.teacher.Game

07-10 15:49:42.074: ERROR/AndroidRuntime(363):     at 
org.chinesetones.teacher.ChineseToneTeacherActivity.onClick(ChineseToneTeacherActivity.java:41)

07-10 15:49:42.074: ERROR/AndroidRuntime(363):     at android.view.View.performClick(View.java:2364)

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

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

发布评论

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

评论(1

墨落成白 2024-11-26 05:34:01

其他答案说这是不可能的

OnLoadCompleteListener Pre-2.2 无解决方案

OnLoadCompleteListener Pre-2.2无解决方案

外部搜索似乎也说了同样的事情 。

当然这并不意味着不可能,他们说Mapview倾斜无法完成,我想出了如何做到这一点

不幸的是,我认为最好的解决方案可能是加载声音,为什么会显示启动画面,当然,您必须“猜测”加载声音需要多长时间。

建议:您还可以通过首先搜索 [Android] OnLoadCompleteListener 更好地了解您的问题。我还会在您的标题中更具体地说明问题,例如“在 2.1 及以下版本中使用什么代替 OnLoadCompleteListener”或类似的内容。

您可以做的另一件事是获取 android 源代码并查看它们如何实现完成侦听器,您也许可以创建一些东西来模拟它。

This other answers say that it's not possible

OnLoadCompleteListener Pre-2.2 No Solution

OnLoadCompleteListener Pre-2.2 No Solution

External searches seem to say the same thing

Of course it does not mean it's not possible, they said Mapview tilting could not be done and I figured out how to do it.

Unfortunately I am thinking the best solution might be load the sound why a splash screen is displayed, of course you would have to "guess" how long the sound takes to load.

Suggestion: You also might get a better idea of your problem by searching first [Android] OnLoadCompleteListener. I would also state problem more specifically in your title, for instance "What to use instead of OnLoadCompleteListener in 2.1 and below" or something like that.

The other thing you can do is get the android source code and see how they implemented the completion listener, you might be able to create something to emulate that.

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