Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Android Vitamio 5.0.2 update Android 7 Nougat crash #385

Open
hoanganh2020 opened this issue May 27, 2016 · 36 comments
Open

Android Vitamio 5.0.2 update Android 7 Nougat crash #385

hoanganh2020 opened this issue May 27, 2016 · 36 comments

Comments

@hoanganh2020
Copy link

hoanganh2020 commented May 27, 2016

Hi,

I used Vitamio 5.0.2 update Android 7 Nougat but crash.

E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.fivething.vietmobi, PID: 3404
java.lang.UnsatisfiedLinkError: No implementation found for void io.vov.vitamio.MediaPlayer.native_init() (tried Java_io_vov_vitamio_MediaPlayer_native_1init and Java_io_vov_vitamio_MediaPlayer_native_1init__)
at io.vov.vitamio.MediaPlayer.native_init(Native Method)
at io.vov.vitamio.MediaPlayer.(MediaPlayer.java:306)
at io.vov.vitamio.widget.VideoView.openVideo(VideoView.java:428)
at io.vov.vitamio.widget.VideoView.setVideoURI(VideoView.java:400)
at io.vov.vitamio.widget.VideoView.setVideoURI(VideoView.java:393)
at com.fivething.vietmobi.Player.e(Player.java:390)
at com.fivething.vietmobi.Player.c(Player.java:295)
at com.fivething.vietmobi.Player$2.onSuccess(Player.java:268)
at com.loopj.android.http.JsonHttpResponseHandler$1$1.run(JsonHttpResponseHandler.java:154)
at android.os.Handler.handleCallback(Handler.java:751)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:154)
at android.app.ActivityThread.main(ActivityThread.java:5969)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:801)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:691)

E/Vitamio[Player]: Error loading libs
java.lang.UnsatisfiedLinkError: Expecting an absolute path of the library: libstlport_shared.so
at java.lang.Runtime.load0(Runtime.java:889)
at java.lang.System.load(System.java:1505)
at io.vov.vitamio.MediaPlayer.load_lib(MediaPlayer.java:258)
at io.vov.vitamio.MediaPlayer.(MediaPlayer.java:319)
at io.vov.vitamio.widget.VideoView.openVideo(VideoView.java:428)
at io.vov.vitamio.widget.VideoView.setVideoURI(VideoView.java:400)
at io.vov.vitamio.widget.VideoView.setVideoURI(VideoView.java:393)
at com.fivething.vietmobi.Player.e(Player.java:390)
at com.fivething.vietmobi.Player.c(Player.java:295)
at com.fivething.vietmobi.Player$2.onSuccess(Player.java:268)
at com.loopj.android.http.JsonHttpResponseHandler$1$1.run(JsonHttpResponseHandler.java:154)
at android.os.Handler.handleCallback(Handler.java:751)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:154)
at android.app.ActivityThread.main(ActivityThread.java:5969)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:801)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:691)

@vinoykr
Copy link

vinoykr commented Jun 6, 2016

Same thing happening for me.

@vinoykr
Copy link

vinoykr commented Jun 6, 2016

Found any solution ?

@mhcpan
Copy link

mhcpan commented Jul 7, 2016

See if the following can help or not.
Same happen to me at v5.0.1 and v5.0.2 with error:

java.lang.UnsatisfiedLinkError: Expecting an absolute path of the library: libstlport_shared.so

Reading mediaplyer.java you would see that Vitamio add checking of SDK_INT at :

public MediaPlayer(Context ctx, boolean preferHWDecoder) {
    mContext = ctx;

    String LIB_ROOT;
    if(VERSION.SDK_INT > 20) {
        LIB_ROOT = "";
    }
    else{
        LIB_ROOT = Vitamio.getLibraryPath();
    }

My experience is that even though with SDK_INT > 20, the librarypath of different handset's implementation could be different and hence java.lang.UnsatisfiedLinkError may be triggered.
To solve it, I modify load_lib library

private static  boolean load_lib(String path, String name){
//    if(path==""){
//        
//        System.load(name);          
//    }
//    else{
//        System.load(path + name);
//    }
      String libraries[] = {name,Vitamio.getLibraryPath() + name};
      boolean success = false;
      for(String library : libraries) {
        try{
          System.load(library);
          success = true;
          break;
        }
        catch(UnsatisfiedLinkError e) {}
      }

      return true;
  }

You can try and see if it can solve your problem.

@victordigio
Copy link

Same problem. This solution doesn't solve my problem.

@MythodeaLoL
Copy link

Dont change vitamio SDK folder names, or file names, make sure u have it.
No implementation found for void io.vov.vitamio.MediaPlayer = U dont have it, or try to rename it, vitamio dont allow u to rename u files, or some functions in this files.

Check all files, and try again.

@hoanganh2020
Copy link
Author

hoanganh2020 commented Aug 31, 2016

Hi FloridaStream,

I don't change any vitamio SDK folder names, or file names.

Android 7.0 nougat same error.

@MythodeaLoL
Copy link

MythodeaLoL commented Aug 31, 2016

Sorry, i cant help more, vitamio have too many problems, every day has +1 =(
R.I.P.

@vicpinm
Copy link

vicpinm commented Sep 1, 2016

-_-

1 similar comment
@MythodeaLoL
Copy link

-_-

@icastell
Copy link

icastell commented Sep 8, 2016

Same error here. Any advance from Vitamio devs?

@robsred
Copy link

robsred commented Sep 9, 2016

Hi guys

Try the folowing:

Append to Vitamio's MediaPlayer.java an extra condition check at both points (MediaPlayer constructor and static clause) where

if (VERSION.SDK_INT > 20 ) { LIB_ROOT = ""; } else { LIB_ROOT = Vitamio.getLibraryPath(); }
and change it to

if (VERSION.SDK_INT > 20 && VERSION.SDK_INT < 24) { LIB_ROOT = ""; } else { LIB_ROOT = Vitamio.getLibraryPath(); }

to enforce Vitamio to check the alternative path for Android 7.0

Tried the above and worked on a Nexus 5X, which just got updated to Nougat and was giving me the same errors when starting my app.

Hope this helps.

@hoanganh2020
Copy link
Author

Hi Robsred,

I tested your code on Nexus 9 with Android 7.0 NRĐ0M but still error.

Thanks!

@hoanganh2020 hoanganh2020 changed the title Android Vitamio 5.0.1 update Android N crash Android Vitamio 5.0.1 update Android 7 Nougat crash Sep 11, 2016
@hoanganh2020 hoanganh2020 changed the title Android Vitamio 5.0.1 update Android 7 Nougat crash Android Vitamio 5.0.2 update Android 7 Nougat crash Sep 11, 2016
@iojaffee
Copy link

Same error here

@azidi
Copy link

azidi commented Oct 13, 2016

i tried robsred answer
if (VERSION.SDK_INT > 20 && VERSION.SDK_INT < 24) { LIB_ROOT = ""; } else { LIB_ROOT = Vitamio.getLibraryPath(); }

worked perfectly on Nexus 6P Nougat

#savemyday

@vicpinm
Copy link

vicpinm commented Oct 17, 2016

Not working robsred solution for me in android studio emulator with android 7.

@Axlchen
Copy link

Axlchen commented Nov 22, 2016

android4.3 occurs this problem too
maybe some .so files are loss i think

@tjj93622
Copy link

@hoanganh2020 Excuse me, have you settled it now? and How did you solve it?

@Jan31
Copy link

Jan31 commented Dec 22, 2016

@FloridaStream I am getting error... can you please help
E/art: No implementation found for boolean io.vov.vitamio.MediaPlayer.loadFFmpeg_native(java.lang.String)

@pmjsankar
Copy link

Im also getting the same error : java.lang.UnsatisfiedLinkError: Expecting an absolute path of the library: libstlport_shared.so
Please please help..

@masmil1988
Copy link

masmil1988 commented Feb 7, 2017

Did you try Vitamio 5.2?
from download page (ensure you load the Chinese version, the English one has not been updated since version 5.0.2) or direct download

@tannt275
Copy link

tannt275 commented Feb 8, 2017

@masmil1988 i have a problem
In same device (real device) && same link url of video, when build app with Vitamio 5.0.2 Video plays normally, but with Vitamio 5.2 Android device says "Can not play this video".
Error in Logcast is "avformat_open_input: Protocol not found : -1330794744"
How do i fix?

@masmil1988
Copy link

@tannt275 I don't know, I'm just a Vitamio user 😕

@ifucolo
Copy link

ifucolo commented Mar 2, 2017

@masmil1988 Your solution work for me, in nexus 5x 7.1.1, I replaced all things about my vitamio to 5.2 version, Thanks a lot

@MythodeaLoL
Copy link

@Jan31 and others, try ijkplayer, is better than vitamio, the best for android and iOS.

https://github.com/Bilibili/ijkplayer

Android/iOS video player based on FFmpeg n3.2, with MediaCodec, VideoToolbox support.

Vitamio is outdated of features and improvments. R.I.P.

README.md 03/03/17

ijkplayer

Platform Build Status
Android Build Status
iOS Build Status

Video player based on ffplay

Download

  • Android:
  • Gradle
# required
allprojects {
    repositories {
        jcenter()
    }
}

dependencies {
    # required, enough for most devices.
    compile 'tv.danmaku.ijk.media:ijkplayer-java:0.7.7.1'
    compile 'tv.danmaku.ijk.media:ijkplayer-armv7a:0.7.7.1'

    # Other ABIs: optional
    compile 'tv.danmaku.ijk.media:ijkplayer-armv5:0.7.7.1'
    compile 'tv.danmaku.ijk.media:ijkplayer-arm64:0.7.7.1'
    compile 'tv.danmaku.ijk.media:ijkplayer-x86:0.7.7.1'
    compile 'tv.danmaku.ijk.media:ijkplayer-x86_64:0.7.7.1'

    # ExoPlayer as IMediaPlayer: optional, experimental
    compile 'tv.danmaku.ijk.media:ijkplayer-exo:0.7.7.1'
}
  • iOS
  • in coming...

My Build Environment

Latest Changes

Features

  • Common
  • remove rarely used ffmpeg components to reduce binary size config/module-lite.sh
  • workaround for some buggy online video.
  • Android
  • platform: API 9~23
  • cpu: ARMv7a, ARM64v8a, x86 (ARMv5 is not tested on real devices)
  • api: MediaPlayer-like
  • video-output: NativeWindow, OpenGL ES 2.0
  • audio-output: AudioTrack, OpenSL ES
  • hw-decoder: MediaCodec (API 16+, Android 4.1+)
  • alternative-backend: android.media.MediaPlayer, ExoPlayer
  • iOS
  • platform: iOS 7.0~10.2.x
  • cpu: armv7, arm64, i386, x86_64, (armv7s is obselete)
  • api: MediaPlayer.framework-like
  • video-output: OpenGL ES 2.0
  • audio-output: AudioQueue, AudioUnit
  • hw-decoder: VideoToolbox (iOS 8+)
  • alternative-backend: AVFoundation.Framework.AVPlayer, MediaPlayer.Framework.MPMoviePlayerControlelr (obselete since iOS 8)

NOT-ON-PLAN

  • obsolete platforms (Android: API-8 and below; iOS: pre-6.0)
  • obsolete cpu: ARMv5, ARMv6, MIPS (I don't even have these types of devices…)
  • native subtitle render
  • avfilter support

Before Build

# install homebrew, git, yasm
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
brew install git
brew install yasm

# add these lines to your ~/.bash_profile or ~/.profile
# export ANDROID_SDK=<your sdk path>
# export ANDROID_NDK=<your ndk path>

# on Cygwin (unmaintained)
# install git, make, yasm
  • If you prefer more codec/format
cd config
rm module.sh
ln -s module-default.sh module.sh
cd android/contrib
# cd ios
sh compile-ffmpeg.sh clean
  • If you prefer less codec/format for smaller binary size (include hevc function)
cd config
rm module.sh
ln -s module-lite-hevc.sh module.sh
cd android/contrib
# cd ios
sh compile-ffmpeg.sh clean
  • If you prefer less codec/format for smaller binary size (by default)
cd config
rm module.sh
ln -s module-lite.sh module.sh
cd android/contrib
# cd ios
sh compile-ffmpeg.sh clean
  • For Ubuntu/Debian users.
# choose [No] to use bash
sudo dpkg-reconfigure dash
  • If you'd like to share your config, pull request is welcome.

Build Android

git clone https://github.com/Bilibili/ijkplayer.git ijkplayer-android
cd ijkplayer-android
git checkout -B latest k0.7.7.1

./init-android.sh

cd android/contrib
./compile-ffmpeg.sh clean
./compile-ffmpeg.sh all

cd ..
./compile-ijk.sh all

# Android Studio:
#     Open an existing Android Studio project
#     Select android/ijkplayer/ and import
#
#     define ext block in your root build.gradle
#     ext {
#       compileSdkVersion = 23       // depending on your sdk version
#       buildToolsVersion = "23.0.0" // depending on your build tools version
#
#       targetSdkVersion = 23        // depending on your sdk version
#     }
#
# If you want to enable debugging ijkplayer(native modules) on Android Studio 2.2+: (experimental)
#     sh android/patch-debugging-with-lldb.sh armv7a
#     Install Android Studio 2.2(+)
#     Preference -> Android SDK -> SDK Tools
#     Select (LLDB, NDK, Android SDK Build-tools,Cmake) and install
#     Open an existing Android Studio project
#     Select android/ijkplayer
#     Sync Project with Gradle Files
#     Run -> Edit Configurations -> Debugger -> Symbol Directories
#     Add "ijkplayer-armv7a/.externalNativeBuild/ndkBuild/release/obj/local/armeabi-v7a" to Symbol Directories
#     Run -> Debug 'ijkplayer-example'
#     if you want to reverse patches:
#     sh patch-debugging-with-lldb.sh reverse armv7a
#
# Eclipse: (obselete)
#     File -> New -> Project -> Android Project from Existing Code
#     Select android/ and import all project
#     Import appcompat-v7
#     Import preference-v7
#
# Gradle
#     cd ijkplayer
#     gradle

Build iOS

git clone https://github.com/Bilibili/ijkplayer.git ijkplayer-ios
cd ijkplayer-ios
git checkout -B latest k0.7.7.1

./init-ios.sh

cd ios
./compile-ffmpeg.sh clean
./compile-ffmpeg.sh all

# Demo
#     open ios/IJKMediaDemo/IJKMediaDemo.xcodeproj with Xcode
# 
# Import into Your own Application
#     Select your project in Xcode.
#     File -> Add Files to ... -> Select ios/IJKMediaPlayer/IJKMediaPlayer.xcodeproj
#     Select your Application's target.
#     Build Phases -> Target Dependencies -> Select IJKMediaFramework
#     Build Phases -> Link Binary with Libraries -> Add:
#         IJKMediaFramework.framework
#
#         AudioToolbox.framework
#         AVFoundation.framework
#         CoreGraphics.framework
#         CoreMedia.framework
#         CoreVideo.framework
#         libbz2.tbd
#         libz.tbd
#         MediaPlayer.framework
#         MobileCoreServices.framework
#         OpenGLES.framework
#         QuartzCore.framework
#         UIKit.framework
#         VideoToolbox.framework
#
#         ... (Maybe something else, if you get any link error)
# 

Support (支持)

  • Please do not send e-mail to me. Public technical discussion on github is preferred.
  • 请尽量在 github 上公开讨论技术问题,不要以邮件方式私下询问,恕不一一回复。

License

Copyright (c) 2017 Bilibili
Licensed under LGPLv2.1 or later

ijkplayer required features are based on or derives from projects below:

android/ijkplayer-exo is based on or derives from projects below:

android/example is based on or derives from projects below:

ios/IJKMediaDemo is based on or derives from projects below:

ijkplayer's build scripts are based on or derives from projects below:

Commercial Use

ijkplayer is licensed under LGPLv2.1 or later, so itself is free for commercial use under LGPLv2.1 or later

But ijkplayer is also based on other different projects under various licenses, which I have no idea whether they are compatible to each other or to your product.

IANAL, you should always ask your lawyer for these stuffs before use it in your product.

@Thangdoan0401
Copy link

Thangdoan0401 commented Mar 30, 2017

@FloridaStream can i build ijkPlayer project in window, it seem have to build in Linux and MacOS?

@amaroarcast
Copy link

With this vitamio version work fine:
http://wscdn.miaopai.com/download/vitamio20160930.zip

Thanks a log @masmil1988

@immujeeb
Copy link

This solution is actually working... Thanks man.

With this vitamio version work fine:
http://wscdn.miaopai.com/download/vitamio20160930.zip

@khantpd01405
Copy link

5.2.3 version worked fine!

@immujeeb
Copy link

immujeeb commented Jun 9, 2017

HI @khantpd01405 ,

Can you please give that vitamio version here again. Link to download above is not working...

Thanks,
Mujeeb.

@immujeeb
Copy link

immujeeb commented Jun 9, 2017

HI @amaroarcast ,

Can you please give that vitamio version here again. Link to download above is not working...

Thanks,
Mujeeb.

@khantpd01405
Copy link

khantpd01405 commented Jun 13, 2017

Hi @immujeeb use can clone this repository https://github.com/yixia/VitamioBundleStudio, , it's the newest version . During work with it if you have some problem. please for me know. ^^

@Dwikarya
Copy link

Dwikarya commented Dec 11, 2017

hi all, i use vitamio version 5.2.3 and get the same problem and i have tried all the above solutions and nothing works.

then i try to change the code bit on MediaPlayer.java

if(LIB_ROOT==null){
    	    	System.loadLibrary("stlport_shared");
    	    	System.loadLibrary("vplayer");	
    	    	loadFFmpeg_native("libffmpeg.so");
    	    	loadVVO_native("libvvo.9.so");
    	    	loadVVO_native("libvvo.9.so");
    	    	loadVAO_native("libvao.0.so");
    	    }else{
    	    	System.load(LIB_ROOT+ "libstlport_shared.so");
    	    	System.load(LIB_ROOT+ "libvplayer.so");
    	    	loadFFmpeg_native(LIB_ROOT+"libffmpeg.so");
    	    	loadVVO_native(LIB_ROOT+ "libvvo.9.so");
    	    	loadVAO_native( LIB_ROOT+ "libvao.0.so");      
    	    }

and replace it with

if(LIB_ROOT==null){
    	    	System.loadLibrary("stlport_shared");
    	    	System.loadLibrary("vplayer");	
    	    	loadFFmpeg_native("libffmpeg.so");
    	    	loadVVO_native("libvvo.9.so");
    	    	loadVVO_native("libvvo.9.so");
    	    	loadVAO_native("libvao.0.so");
    	    }else{
                  System.loadLibrary("stlport_shared");
                  System.loadLibrary("vplayer");
                  loadFFmpeg_native("libffmpeg.so");
                  loadVVO_native("libvvo.9.so");
                  loadVVO_native("libvvo.9.so");
                  loadVAO_native("libvao.0.so");
    	    }

after that I try in emulator android 7.1.1 and succeed
I hope this way also solve your problem :)

@TD-Null
Copy link

TD-Null commented Mar 6, 2018

Yup having errors with the bundle gonna try the link that everyone is using

@findxain
Copy link

Hi Folks i know its late but at least it not never :D

go to MediaPlaayer.java and change line 361 like this

 if(LIB_ROOT==null){
    	    	System.loadLibrary("stlport_shared");
    	    	System.loadLibrary("vplayer");
    	    	loadFFmpeg_native("libffmpeg.so");
    	    	loadVVO_native("libvvo.9.so");
    	    	loadVVO_native("libvvo.9.so");
    	    	loadVAO_native("libvao.0.so");
    	    }else{
    	    	System.load(LIB_ROOT+ "libstlport_shared.so");
    	    	System.load(LIB_ROOT+ "libvplayer.so");
    	    	loadFFmpeg_native(LIB_ROOT+"libffmpeg.so");
    	    	loadVVO_native(LIB_ROOT+ "libvvo.9.so");
    	    	loadVAO_native( LIB_ROOT+ "libvao.0.so");
    	    }
 if(LIB_ROOT==null||LIB_ROOT.isEmpty()){
    	    	System.loadLibrary("stlport_shared");
    	    	System.loadLibrary("vplayer");
    	    	loadFFmpeg_native("libffmpeg.so");
    	    	loadVVO_native("libvvo.9.so");
    	    	loadVVO_native("libvvo.9.so");
    	    	loadVAO_native("libvao.0.so");
    	    }else{
    	    	System.load(LIB_ROOT+ "libstlport_shared.so");
    	    	System.load(LIB_ROOT+ "libvplayer.so");
    	    	loadFFmpeg_native(LIB_ROOT+"libffmpeg.so");
    	    	loadVVO_native(LIB_ROOT+ "libvvo.9.so");
    	    	loadVAO_native( LIB_ROOT+ "libvao.0.so");
    	    }

and its working now on nougat

Have a nice Day 💃

@whpVishal
Copy link

Don't you guys forget to initialize the Vitamio in onCreate()
Vitamio.isInitialized(getApplicationContext());

@JackyAnd
Copy link

where is the url of vitamio version 5.2.3 ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests