Android NDK 本机音频示例崩溃

发布于 2024-11-26 19:22:57 字数 309 浏览 0 评论 0原文

我已经构建了本机音频示例并将其下载到我的 Galaxy Tab 10.1,但它不起作用。看起来它即将启动(即窗口名称出现在顶部),但随后严重崩溃。我希望有人能知道为什么?可能是选项卡上的音频支持有问题,或者......?

我还尝试使用“android_native_app_glue”创建我自己的非常简单的本机活动,它也崩溃了——即使我没有进行 OpenSL 调用。事实上,我所要做的就是将 -lOpenSLES 添加到我的 LOCAL_LDLIBS 中以导致启动崩溃。当我删除该链接器标志时,没有崩溃。很奇怪,让我觉得选项卡中缺少有关本机音频支持的东西?

谢谢, 阿尔法

I've built the native-audio example and downloaded it to my Galaxy Tab 10.1, but it doesn't work. It looks like it's going to start (i.e. the window name appears across the top), but then crashes hard. I'm hoping someone might have an idea as to why? Is it perhaps a problem with audio support on the Tab, or...?

I also tried creating my own very simple native activity using "android_native_app_glue" and it crashes too -- even though I make no OpenSL calls. In fact, all I have to do is add -lOpenSLES to my LOCAL_LDLIBS to cause a startup crash. When I remove that linker flag, no crash. Very odd and makes me think there's just something missing from the Tab with regards to native audio support?

Thanks,
ALF

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

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

发布评论

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

评论(1

や莫失莫忘 2024-12-03 19:22:57

事实上,我所要做的就是将 -lOpenSLES 添加到我的 LOCAL_LDLIBS 中以导致启动崩溃。当我删除该链接器标志时,没有崩溃。非常奇怪,让我觉得选项卡中缺少有关本机音频支持的内容?

您 logcat 似乎表明加载 /data/data/com.example.native_activity/lib/libnative-activity.so 失败。如果无法复制问题来验证将导致的错误消息,这很可能是由于运行时链接器无法找到要加载的引用系统库,或者可能是无法找到 libnative 的令人困惑的报告 - Activity.so 本身,或者 lib 中未解析的符号,或者其他东西。

如果您有另一台设备要测试,那将是一条明显的路径。

还测试来自已知使用本机音频的其他人的编译应用程序。

如果这些都不可能,您可能可以使用 readelf 或 objdump (尤其是 ndk 安装中的 android 版本)甚至 strings 或 grep 来查找 libnative-activity.so 所需的系统库的名称,然后查看它们是否实际上存在于您的设备上。

In fact, all I have to do is add -lOpenSLES to my LOCAL_LDLIBS to cause a startup crash. When I remove that linker flag, no crash. Very odd and makes me think there's just something missing from the Tab with regards to native audio support?

You logcat seems to indicate that loading of /data/data/com.example.native_activity/lib/libnative-activity.so is failing. Without being able to duplicate the problem to verify the error messages that would result, this might well be due to the runtime linker being unable to find a referenced system library to load, or it could be a confusing report of being unable to find libnative-activity.so itself, or and unresolved symbol in the lib, or something else.

If you had another device to test on, that would be an obvious path.

Also testing a compiled app from someone else known to use native audio.

If neither of those is possible, you could probably use readelf or objdump (especially the android version somewhere in the ndk install) or even strings or grep to find the names of system libraries required by your libnative-activity.so and then see if they are in fact present on your device.

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