Android,共享库依赖项

发布于 2025-01-01 06:48:12 字数 528 浏览 5 评论 0原文

  1. 我正在 Android 上实现一个使用 LibAv/ffmpeg 的应用程序
  2. 我正在使用 JNI 与本机代码交互
  3. 我的“共享库”正在使用 libswscale.so、libavutil.so、libavformat.so、libavdevice.so、libavcore.so 和libavcodec.so。
  4. 所有“共享库”都经过验证,打包到 APK 文件上的同一目录中,
  5. 我正在设备上调试(无模拟器)
  6. Runtime.loadLibrary($MY_LIB_NAME) 触发 UnsatisfiedLinkError 异常
  7. 直接运行 'System.loadLibrary("swscale" )' 也会导致 UnsatisfiedLinkError 异常

我的猜测是 libav*.so 依赖于应添加到 APK 中的其他库,但是,我不确定如何检测这些。 有没有工具可以检测依赖的共享库? (窗口 ddepend 等效)?

任何帮助将不胜感激。

〜纳达夫

  1. I am Implementing an application that is using LibAv/ffmpeg on Android
  2. I am using JNI to interact with the Native code
  3. my 'Shared Lib' is using libswscale.so, libavutil.so, libavformat.so, libavdevice.so, libavcore.so and libavcodec.so.
  4. All the 'Shared Libs' are verified to be packed to the same directory on the APK file
  5. I am debugging on the device ( no emulator )
  6. Runtime.loadLibrary($MY_LIB_NAME) trigger an UnsatisfiedLinkError exception
  7. Directly running 'System.loadLibrary("swscale")' also cause an UnsatisfiedLinkError exception

My guess is that libav*.so is dependent on additional libs that should be added to the APK, however, I am not sure how to detect these.
Is there any tool to detect dependent Shared libraries? ( Window ddepends equivalent ) ?

Any help will be appreciated.

~Nadav

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

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

发布评论

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

评论(1

阿楠 2025-01-08 06:48:12

您可以使用 objdump 工具列出所需的共享库:

<ANDROID_NDK_ROOT>\toolchains\arm-linux-androideabi-4.4.3\prebuilt\windows\bin\arm-linux-androideabi-objdump -p libNAME.so | grep NEEDED

适用于 Windows。更改您操作系统的 objdump 工具的路径。

You can use objdump tool to list needed shared libraries:

<ANDROID_NDK_ROOT>\toolchains\arm-linux-androideabi-4.4.3\prebuilt\windows\bin\arm-linux-androideabi-objdump -p libNAME.so | grep NEEDED

That's for windows. Change path to objdump tool for your OS.

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