Android Vitamio 5.0.0 library crash

家住魔仙堡 提交于 2019-12-07 19:26:39

问题


I updated Vitamio 4.2.2 to 5.0.0 as Google requested because of security issues in developer console. But with the same codes, it crashes like below:

java.lang.UnsatisfiedLinkError: dlopen failed: library "nulllibstlport_shared.so" not found
at java.lang.Runtime.load(Runtime.java:332)
at java.lang.System.load(System.java:981)
at io.vov.vitamio.MediaPlayer.<clinit>(MediaPlayer.java:257)
at io.vov.vitamio.widget.VideoView.openVideo(VideoView.java:431)
at io.vov.vitamio.widget.VideoView.setVideoURI(VideoView.java:403)
at io.vov.vitamio.widget.VideoView.setVideoURI(VideoView.java:396)
at io.vov.vitamio.widget.VideoView.setVideoPath(VideoView.java:392)
at com.mypackage.myapp.LiveStreamActivity$LiveStreamParse.onPostExecute(LiveStreamActivity.java:131)

The crash happens when I call videoView.setVideoPath(liveStreamUrl); as below:

VideoView videoView = (VideoView) findViewById(R.id.vvSurface);
videoView.setVideoPath(liveStreamUrl);
final MediaController mediaController = new MediaController(LiveStreamActivity.this);
videoView.setMediaController(mediaController);
videoView.setVideoLayout(VideoView.VIDEO_LAYOUT_STRETCH, 0);
videoView.requestFocus();
videoView.start();

videoView.setOnPreparedListener(new MediaPlayer.OnPreparedListener() {
    @Override
    public void onPrepared(MediaPlayer mediaPlayer) {
         mediaPlayer.setPlaybackSpeed(1.0f);
    }
});

When I look the sample of Vitamio 5.0.0, nothing changed for VideoView. So it seems Vitamio has totally ruined itself. Even though they published this release on 2015-11-02, they are still targeting SDK version to API 19. This is really shame.

Any suggestions for this unfortunate issue will be appreciated besides expecting appropriate answers from Vitamio team.


回答1:


As it seems your app failing to found "nulllibstlport_shared.so" native library. And when it comes to native it's useful to specify the particular device on which problem occurs.

However, on Vitamio website they say that lib is currently supporting: ARMv6, VFP, ARMv7, NEON,MIPS,X86 etc... So I suggest you try to force your app include native libs only for supported ABI.

For this you need to add this to app/build.gradle

defaultConfig {
    ...

    ndk {
        abiFilters "armeabi", "armeabi-v7a", "x86", "mips"
    }
}

and in the root folder of your project find gradle.properties file and add there 'android.useDeprecatedNdk=true'

# Project-wide Gradle settings.

# IDE (e.g. Android Studio) users:
# Gradle settings configured through the IDE *will override*
...
# org.gradle.parallel=true

android.useDeprecatedNdk=true

But I don't really know if this would help.




回答2:


There is no LibsCheck class in Vitamio 5.0. It's required to run in onCreate function.

It seems Vitamio 5.0 is not complited. It doesn't use ffmpeg library and it can't play.




回答3:


Late reply,

But this can work (Worked for me at least when I had same error)

 Vitamio.isInitialized(this);

Or

 Vitamio.isInitialized(getApplicationContext());

in onCreate of your activity.




回答4:


for solve specifically that problem, the thing that I did, was to modify the file MediaPlayer.java, located in src/io/vov/vitamio/. On the line 253 says:

String LIB_ROOT = Vitamio.getLibraryPath();

and you should change it for:

String LIB_ROOT = "/data/data/your.package.name/lib/";

Anyway, if you are not sure, you can debug the app, stopping just in that line, and the variable LIB_ROOT, will have the complete route.

Now I have another problem making work this library. But I hope this help.



来源:https://stackoverflow.com/questions/34599764/android-vitamio-5-0-0-library-crash

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!