首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Vitamio FileNotFoundException

Vitamio FileNotFoundException
EN

Stack Overflow用户
提问于 2014-03-11 17:17:09
回答 2查看 579关注 0票数 0

我正在尝试使用vitamio来玩流媒体hls。我播放流时出现错误

代码语言:javascript
复制
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)

请帮帮我。谢谢

EN

回答 2

Stack Overflow用户

发布于 2014-03-11 17:20:42

您正在提供该文件

代码语言:javascript
复制
/data/data/com.example.esporttv/libs/.lock

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

你能不能把初始化玩家的代码行也贴出来?

票数 0
EN

Stack Overflow用户

发布于 2015-12-17 16:58:00

如果你使用的是Android Studio,这里是解决方案,原创文章here

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

lib\armeabi-v7a

..。

lib\armeabi

将lib文件夹压缩到一个文件中,例如abc.zip;

  • Rename abc.jar

  • Copy abc。zip->abc.jar

  • Copy this abc.jar to your project子文件夹,任何地方都可以,但我通常会把它放在app\libs\abc.jar

  • In build.gradle,add below行中。

就是这样!

代码语言:javascript
复制
dependencies {
    compile files(‘libs/abc.jar’)
     …
}
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/22321210

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档