yixia / VitamioBundle

Vitamio for Android
http://www.vitamio.org/en/
Other
5.27k stars 2.07k forks source link

Android Vitamio 5.0.2 update Android 7 Nougat crash #385

Open hoanganh2020 opened 8 years ago

hoanganh2020 commented 8 years ago

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 commented 8 years ago

Same thing happening for me.

vinoykr commented 8 years ago

Found any solution ?

mhcpan commented 8 years ago

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 commented 8 years ago

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

MythodeaLoL commented 8 years ago

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 commented 8 years ago

Hi FloridaStream,

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

Android 7.0 nougat same error.

MythodeaLoL commented 8 years ago

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

vicpinm commented 8 years ago

-_-

MythodeaLoL commented 8 years ago

-_-

icastell commented 8 years ago

Same error here. Any advance from Vitamio devs?

robsred commented 8 years ago

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 commented 8 years ago

Hi Robsred,

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

Thanks!

iojaffee commented 7 years ago

Same error here

azidi commented 7 years ago

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 commented 7 years ago

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

Axlchen commented 7 years ago

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

tjj93622 commented 7 years ago

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

Jan31 commented 7 years ago

@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 commented 7 years ago

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

masmil1988 commented 7 years ago

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 commented 7 years ago

@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 commented 7 years ago

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

ifucolo commented 7 years ago

@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 commented 7 years ago

@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

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
- Common
 - Mac OS X 10.11.5
- Android
 - [NDK r10e](http://developer.android.com/tools/sdk/ndk/index.html)
 - Android Studio 2.1.3
 - Gradle 2.14.1
- iOS
 - Xcode 7.3 (7D175)
- [HomeBrew](http://brew.sh)
 - ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
 - brew install git

### Latest Changes
- [NEWS.md](NEWS.md)

### Features
- Common
 - remove rarely used ffmpeg components to reduce binary size [config/module-lite.sh](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](android/ijkplayer/ijkplayer-java/src/main/java/tv/danmaku/ijk/media/player/IMediaPlayer.java)
 - 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](ios/IJKMediaPlayer/IJKMediaPlayer/IJKMediaPlayback.h)
 - 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=

export ANDROID_NDK=

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 上公开讨论[技术问题](https://github.com/bilibili/ijkplayer/issues),不要以邮件方式私下询问,恕不一一回复。

### License

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



ijkplayer required features are based on or derives from projects below:
- LGPL
  - [FFmpeg](http://git.videolan.org/?p=ffmpeg.git)
  - [libVLC](http://git.videolan.org/?p=vlc.git)
  - [kxmovie](https://github.com/kolyvan/kxmovie)
- zlib license
  - [SDL](http://www.libsdl.org)
- BSD-style license
  - [libyuv](https://code.google.com/p/libyuv/)
- ISC license
  - [libyuv/source/x86inc.asm](https://code.google.com/p/libyuv/source/browse/trunk/source/x86inc.asm)

android/ijkplayer-exo is based on or derives from projects below:
- Apache License 2.0
  - [ExoPlayer](https://github.com/google/ExoPlayer)

android/example is based on or derives from projects below:
- GPL
  - [android-ndk-profiler](https://github.com/richq/android-ndk-profiler) (not included by default)

ios/IJKMediaDemo is based on or derives from projects below:
- Unknown license
  - [iOS7-BarcodeScanner](https://github.com/jpwiddy/iOS7-BarcodeScanner)

ijkplayer's build scripts are based on or derives from projects below:
- [gas-preprocessor](http://git.libav.org/?p=gas-preprocessor.git)
- [VideoLAN](http://git.videolan.org)
- [yixia/FFmpeg-Android](https://github.com/yixia/FFmpeg-Android)
- [kewlbear/FFmpeg-iOS-build-script](https://github.com/kewlbear/FFmpeg-iOS-build-script) 

### 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](https://en.wikipedia.org/wiki/IANAL), you should always ask your lawyer for these stuffs before use it in your product.
Thangdoan0401 commented 7 years ago

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

amaroarcast commented 7 years ago

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

Thanks a log @masmil1988

immujeeb commented 7 years ago

This solution is actually working... Thanks man.

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

khantpd01405 commented 7 years ago

5.2.3 version worked fine!

immujeeb commented 7 years ago

HI @khantpd01405 ,

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

Thanks, Mujeeb.

immujeeb commented 7 years ago

HI @amaroarcast ,

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

Thanks, Mujeeb.

khantpd01405 commented 7 years ago

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 commented 6 years ago

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 commented 6 years ago

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

findxain commented 6 years ago

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 commented 5 years ago

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

JackyAnd commented 4 years ago

where is the url of vitamio version 5.2.3 ?