在我的android项目中不能包含FFmpegMediaPlayer lib

时间:2015-08-19 10:19:58

标签: android android-studio ffmpeg audio-streaming decoding

我要在我的Android工作室项目中加入一个用于管理来自网址的音频流的lib。我想要使​​用this,但是当我尝试运行应用程序并且它到达必须实例化FFmpegMediaPlayer对象的点时,它就会出现错误

08-19 10:20:42.066  31444-31444/? E/AndroidRuntime﹕ FATAL EXCEPTION: main
    java.lang.ExceptionInInitializerError
            at com.example.lucabrognara.radiostreamprova.RadioActivity.onCreate(RadioActivity.java:126)
            at android.app.Activity.performCreate(Activity.java:5206)
            at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1094)
            at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2074)
            at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2135)
            at android.app.ActivityThread.access$700(ActivityThread.java:140)
            at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1237)
            at android.os.Handler.dispatchMessage(Handler.java:99)
            at android.os.Looper.loop(Looper.java:137)
            at android.app.ActivityThread.main(ActivityThread.java:4921)
            at java.lang.reflect.Method.invokeNative(Native Method)
            at java.lang.reflect.Method.invoke(Method.java:511)
            at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1027)
            at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:794)
            at dalvik.system.NativeStart.main(Native Method)
     Caused by: java.lang.UnsatisfiedLinkError: Cannot load library: link_image[1892]:  1836 could not load needed library 'libswresample.so' for 'libavcodec.so' (load_library[1094]: Library 'libswresample.so' not found)
            at java.lang.Runtime.load(Runtime.java:340)
            at java.lang.System.load(System.java:521)
            at wseemann.media.FFmpegMediaPlayer.<clinit>(FFmpegMediaPlayer.java:604)
            at com.example.lucabrognara.radiostreamprova.RadioActivity.onCreate(RadioActivity.java:126)
            at android.app.Activity.performCreate(Activity.java:5206)
            at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1094)
            at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2074)
            at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2135)
            at android.app.ActivityThread.access$700(ActivityThread.java:140)
            at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1237)
            at android.os.Handler.dispatchMessage(Handler.java:99)
            at android.os.Looper.loop(Looper.java:137)
            at android.app.ActivityThread.main(ActivityThread.java:4921)
            at java.lang.reflect.Method.invokeNative(Native Method)
            at java.lang.reflect.Method.invoke(Method.java:511)
            at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1027)
            at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:794)
            at dalvik.system.NativeStart.main(Native Method)

我已经完成了将lib集成到项目中的步骤:

  • 我从demo项目中复制了所有.so,gdb.setup和gdbserver文件,并将它们放入我的jniLibs中复制确切的文件夹结构
  • 我从demo my libs forlder
  • 复制了fmp.jar
  • 我已使用项目文件夹结构
  • 相应地更改了gdb.setup文件中的所有路径
  • 与gradle同步

我不是专门针对此类任务的Android专家,我错过了一些重要的事情吗?如果您需要,我可以提供测试应用程序

三江源

修改1

这是完整的错误

                Robot r = new Robot();
                r.mouseMove(635, 210); // brings focus on login popup window, got location(x,y coordinates) from Mouse-Position chrome plugin
                // left-click mouse on the location
                r.mousePress(MouseEvent.BUTTON1_MASK);
                r.mouseRelease(MouseEvent.BUTTON1_MASK);
                //simulating Enter key press, this automatically clicks login and submits the form
                r.keyPress(KeyEvent.VK_ENTER);
                r.keyRelease(KeyEvent.VK_ENTER);

1 个答案:

答案 0 :(得分:1)

显然,仔细阅读文档就足够了:

  

如果您不想构建模块,您可以简单地解压缩预先构建的模块并将它们复制到您的项目&#34; libs&#34;夹

这些正确的步骤:

  • 创建一个android studio项目
  • 解压缩jniLibs文件夹中的预建模块
  • 将fmp.jar文件放在libs文件夹中
  • 显然在清单中包含了android.permission.INTERNET