开发者

Android NDK native-audio example crashes

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_开发者_如何学Pythonglue" 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


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜