Importing Android NDK projects (to decode OGG)

試著忘記壹切 提交于 2019-12-11 11:58:27

问题


I am trying to decode OGG files in Android using an NDK project (I've tried a few). No matter which one I try, I always get an error similar to this when I build:

Caused by: java.lang.UnsatisfiedLinkError: Couldn't load videokit: findLibrary returned null

I'm very new to the NDK (obviously) so I'm not sure what I'm doing wrong. All I want to do is to be able to set the playback rate of an OGG file.


回答1:


The java part of the code links to a shared library object (.so file), which is obtained by compiling the C++/NDK parts of the code with ndk-build. In this case, your app is not able to find the right .so file to load. Here are a few things you could check for -

  1. Very basic check - did you run "ndk-build" inside the jni folder? If you didn't, no .so file is generated - eclipse will still compile your project, but it won't work.
  2. If your project root directory is PROJECT, check $(PROJECT)/jni/libs/armeabi or $(PROJECT)/jni/libs/armeabi-v7a - either or both of the locations should contain a .so file once you are done with the "ndk-build" command.
  3. Check that somewhere in your java code, you are invoking "System.LoadLibrary" on this .so file. I think it should be "System.LoadLibrary(videokit)", but I am not sure.


来源:https://stackoverflow.com/questions/14820592/importing-android-ndk-projects-to-decode-ogg

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