gpt4 book ai didi

Android java.lang.UnsatisfiedLinkError - 找不到 "libffmpeg.so"

转载 作者:行者123 更新时间:2023-11-30 05:29:24 27 4
gpt4 key购买 nike

我已经用 eclipse 构建了这个项目 https://github.com/youtube/yt-watchme它运行良好,但是当我尝试在 android studio 中构建这个项目时,我的 Ffmpeg 类出现错误,我已将我在 eclipse 中制作的运行演示中的所有文件复制到我的 android studio 项目目录,我将发布我的目录结构和 build.gradle ,请有人指导我吗?请看下面

Process: com.google.android.apps.watchme, PID: 6330
java.lang.UnsatisfiedLinkError: dalvik.system.PathClassLoader[DexPathList[[zip file "/data/app/com.google.android.apps.watchme-2/base.apk"],nativeLibraryDirectories=[/vendor/lib, /system/lib]]] couldn't find "libffmpeg.so"
at java.lang.Runtime.loadLibrary(Runtime.java:366)
at java.lang.System.loadLibrary(System.java:988)
at com.google.android.apps.watchme.Ffmpeg.<clinit>(Ffmpeg.java:22)
at com.google.android.apps.watchme.VideoStreamingConnection.open(VideoStreamingConnection.java:71)
at com.google.android.apps.watchme.StreamerService.startStreaming(StreamerService.java:73)
at com.google.android.apps.watchme.StreamerActivity.startStreaming(StreamerActivity.java:161)
at com.google.android.apps.watchme.StreamerActivity.access$200(StreamerActivity.java:39)
at com.google.android.apps.watchme.StreamerActivity$1.onServiceConnected(StreamerActivity.java:55)
at android.app.LoadedApk$ServiceDispatcher.doConnected(LoadedApk.java:1208)
at android.app.LoadedApk$ServiceDispatcher$RunConnection.run(LoadedApk.java:1225)
at android.os.Handler.handleCallback(Handler.java:739)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:135)
at android.app.ActivityThread.main(ActivityThread.java:5343)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:905)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:700)

enter image description here

在 JNI 函数中

enter image description here

最佳答案

是否为所有 abis 添加了“libffmpeg.so”文件?('x86'、'x86_64'、'armeabi'、'armeabi-v7a'、'arm64-v8a'、'mips'、'mips64')如果没有,则仅为可用的 abis 生成 apk。假设有 libffmpeg.so 文件用于 'armeabi'、'armeabi-v7a' abis。然后你需要在 app.gradle 的 android {} 部分的结尾添加以下内容。

splits {

// Configures multiple APKs based on ABI.
abi {

// Enables building multiple APKs per ABI.
enable true

// By default all ABIs are included, so use reset() and include to specify that we only
// want APKs for x86, armeabi-v7a, and mips.

// Resets the list of ABIs that Gradle should create APKs for to none.
reset()

// Specifies a list of ABIs that Gradle should create APKs for.


include 'armeabi', 'armeabi-v7a'
// Specifies that we do not want to also generate a universal APK that includes all ABIs.
universalApk false
}
}

关于Android java.lang.UnsatisfiedLinkError - 找不到 "libffmpeg.so",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36424134/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com