Vitamio FileNotFoundException

时间:2014-03-11 09:17:09

标签: android vitamio

我正在尝试使用vitamio来播放流式传输。我播放流时包含错误

03-11 16:12:25.836: E/Vitamio[Player](344): isNativeLibsInited
03-11 16:12:25.836: E/Vitamio[Player](344): java.io.FileNotFoundException: /data/data/com.example.esporttv/libs/.lock (No such file or directory)
03-11 16:12:25.836: E/Vitamio[Player](344):     at org.apache.harmony.luni.platform.OSFileSystem.open(Native Method)
03-11 16:12:25.836: E/Vitamio[Player](344):     at dalvik.system.BlockGuard$WrappedFileSystem.open(BlockGuard.java:232)
03-11 16:12:25.836: E/Vitamio[Player](344):     at java.io.FileInputStream.<init>(FileInputStream.java:80)
03-11 16:12:25.836: E/Vitamio[Player](344):     at java.io.FileReader.<init>(FileReader.java:42)
03-11 16:12:25.836: E/Vitamio[Player](344):     at io.vov.vitamio.Vitamio.isInitialized(Vitamio.java:128)
03-11 16:12:25.836: E/Vitamio[Player](344):     at io.vov.vitamio.LibsChecker.checkVitamioLibs(LibsChecker.java:40)
03-11 16:12:25.836: E/Vitamio[Player](344):     at com.example.esporttv.Player$2.onClick(Player.java:97)
03-11 16:12:25.836: E/Vitamio[Player](344):     at android.view.View.performClick(View.java:2485)
03-11 16:12:25.836: E/Vitamio[Player](344):     at android.view.View$PerformClick.run(View.java:9080)
03-11 16:12:25.836: E/Vitamio[Player](344):     at android.os.Handler.handleCallback(Handler.java:587)
03-11 16:12:25.836: E/Vitamio[Player](344):     at android.os.Handler.dispatchMessage(Handler.java:92)
03-11 16:12:25.836: E/Vitamio[Player](344):     at android.os.Looper.loop(Looper.java:123)
03-11 16:12:25.836: E/Vitamio[Player](344):     at android.app.ActivityThread.main(ActivityThread.java:3683)
03-11 16:12:25.836: E/Vitamio[Player](344):     at java.lang.reflect.Method.invokeNative(Native Method)
03-11 16:12:25.836: E/Vitamio[Player](344):     at java.lang.reflect.Method.invoke(Method.java:507)
03-11 16:12:25.836: E/Vitamio[Player](344):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)
03-11 16:12:25.836: E/Vitamio[Player](344):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
03-11 16:12:25.836: E/Vitamio[Player](344):     at dalvik.system.NativeStart.main(Native Method)
03-11 16:12:26.166: E/Vitamio[Player](344): isNativeLibsInited
03-11 16:12:26.166: E/Vitamio[Player](344): java.io.FileNotFoundException: /data/data/com.example.esporttv/libs/.lock (No such file or directory)
03-11 16:12:26.166: E/Vitamio[Player](344):     at org.apache.harmony.luni.platform.OSFileSystem.open(Native Method)
03-11 16:12:26.166: E/Vitamio[Player](344):     at dalvik.system.BlockGuard$WrappedFileSystem.open(BlockGuard.java:232)
03-11 16:12:26.166: E/Vitamio[Player](344):     at java.io.FileInputStream.<init>(FileInputStream.java:80)
03-11 16:12:26.166: E/Vitamio[Player](344):     at java.io.FileReader.<init>(FileReader.java:42)
03-11 16:12:26.166: E/Vitamio[Player](344):     at io.vov.vitamio.Vitamio.isInitialized(Vitamio.java:128)
03-11 16:12:26.166: E/Vitamio[Player](344):     at io.vov.vitamio.Vitamio.initialize(Vitamio.java:102)
03-11 16:12:26.166: E/Vitamio[Player](344):     at io.vov.vitamio.activity.InitActivity$1.doInBackground(InitActivity.java:55)
03-11 16:12:26.166: E/Vitamio[Player](344):     at io.vov.vitamio.activity.InitActivity$1.doInBackground(InitActivity.java:1)
03-11 16:12:26.166: E/Vitamio[Player](344):     at android.os.AsyncTask$2.call(AsyncTask.java:185)
03-11 16:12:26.166: E/Vitamio[Player](344):     at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:306)
03-11 16:12:26.166: E/Vitamio[Player](344):     at java.util.concurrent.FutureTask.run(FutureTask.java:138)
03-11 16:12:26.166: E/Vitamio[Player](344):     at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1088)
03-11 16:12:26.166: E/Vitamio[Player](344):     at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:581)
03-11 16:12:26.166: E/Vitamio[Player](344):     at java.lang.Thread.run(Thread.java:1019)

请帮帮我。感谢

2 个答案:

答案 0 :(得分:0)

您正在提供文件

/data/data/com.example.esporttv/libs/.lock

作为流媒体来源。您应该始终使用file.exists()函数检查文件是否存在。

你还可以发布初始化播放器的行吗?

答案 1 :(得分:0)

如果您使用的是Android Studio,则此解决方案是原始文章here

  • 创建名为“lib”的文件夹(必须正好是此名称)
  • 在lib中创建具有所需体系结构名称的子文件夹,例如 “armeabi-v7a”“armeabi”等。
  • 将所有* .so文件放在刚刚创建的文件夹中。现在你的文件夹结构应该是这样的:

      

    LIB \ armeabi-V7A

         

    ...

         

    的lib \ armeabi

  • 将lib文件夹压缩到一个文件中,例如abc.zip;
  • 重命名此abc。 zip - &gt; ABC。的
  • 将此abc.jar复制到您的项目子文件夹,任何地方应该这样做,但是 我通常会把它放在app \ libs \ abc.jar
  • 在build.gradle中,添加以下行。

就是这样!

dependencies {
    compile files(‘libs/abc.jar’)
     …
}