2016-04-05 154 views
1

我已經用eclipse https://github.com/youtube/yt-watchme來構建這個項目,它運行良好,但是當我嘗試在android studio中構建這個項目時,我在我的Ffmpeg中出錯類,我已經將我在eclipse中運行的演示文件中的所有文件複製到我的android studio項目目錄中,我將發佈我的目錄結構和build.gradle,請任何人指導我?請參閱下面Android java.lang.UnsatisfiedLinkError - 找不到「libffmpeg.so」

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

+0

您的jni文件夾位置在哪裏?把它放在src-> main-> jni –

+0

是的,我已經創建了文件夾在相同的位置,你可以檢查在屏幕快照 – Achin

+0

請參閱屏幕截圖 – Achin

回答

1

有你添加到所有ABIS「libffmpeg.so」文件?( '86', 'x86_64的' ,'armeabi','armeabi-v7a','arm64-v8a','mips','mips64') 如果沒有,則生成僅適用於abis的apk。 假設有'armeabi','armeabi-v7a'abis的libffmpeg.so文件。那麼你需要將以下內容添加到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 
    } 
} 
相關問題