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

Exception only in release (UnsatisfiedLinkError) #2490

Closed
enigmadevs opened this issue Dec 25, 2016 · 13 comments
Closed

Exception only in release (UnsatisfiedLinkError) #2490

enigmadevs opened this issue Dec 25, 2016 · 13 comments

Comments

@enigmadevs
Copy link

Hi, i got this exception when i run my app in release (in debug all works fine):

java.lang.UnsatisfiedLinkError: JNI_ERR returned from JNI_OnLoad in "/data/app/com.nymeros.playmx-1/lib/arm/libijksdl.so"
	at java.lang.Runtime.loadLibrary(Runtime.java:372)
	at java.lang.System.loadLibrary(System.java:1076)
	at tv.danmaku.ijk.media.player.IjkMediaPlayer$1.a(Unknown Source)
	at tv.danmaku.ijk.media.player.IjkMediaPlayer.a(Unknown Source)
	at tv.danmaku.ijk.media.player.IjkMediaPlayer.b(Unknown Source)
	at tv.danmaku.ijk.media.player.IjkMediaPlayer.<init>(Unknown Source)
	at tv.danmaku.ijk.media.player.IjkMediaPlayer.<init>(Unknown Source)
	at com.nymeros.playmx.ijkPlayer.widget.media.IjkVideoView.a(Unknown Source)
	at com.nymeros.playmx.ijkPlayer.widget.media.IjkVideoView.c(Unknown Source)
	at com.nymeros.playmx.ijkPlayer.widget.media.IjkVideoView.r(Unknown Source)
	at com.nymeros.playmx.ijkPlayer.widget.media.IjkVideoView$8.a(Unknown Source)
	at com.nymeros.playmx.ijkPlayer.widget.media.e$b.surfaceCreated(Unknown Source)
	at android.view.SurfaceView.updateWindow(SurfaceView.java:597)
	at android.view.SurfaceView$3.onPreDraw(SurfaceView.java:179)
	at android.view.ViewTreeObserver.dispatchOnPreDraw(ViewTreeObserver.java:944)
	at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:2098)
	at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1150)
	at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:6061)
	at android.view.Choreographer$CallbackRecord.run(Choreographer.java:860)
	at android.view.Choreographer.doCallbacks(Choreographer.java:672)
	at android.view.Choreographer.doFrame(Choreographer.java:608)
	at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:846)
	at android.os.Handler.handleCallback(Handler.java:739)
	at android.os.Handler.dispatchMessage(Handler.java:95)
	at android.os.Looper.loop(Looper.java:148)
	at android.app.ActivityThread.main(ActivityThread.java:5458)
	at java.lang.reflect.Method.invoke(Native Method)
	at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:738)
	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:628)

This happens when video fragment is loaded.

I use IjkPlayer in other app when very similar code and doesn't crash.

What am i doing wrong?

@xinzhengzhang
Copy link
Member

xinzhengzhang commented Dec 26, 2016

It seems you haven't packed the ijk jni library.

@enigmadevs
Copy link
Author

I added this to my build.gradle:

// required, enough for most devices.
compile 'tv.danmaku.ijk.media:ijkplayer-java:0.7.5'
compile 'tv.danmaku.ijk.media:ijkplayer-armv7a:0.7.5'

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

// ExoPlayer as IMediaPlayer: optional, experimental
compile 'tv.danmaku.ijk.media:ijkplayer-exo:0.7.5'

And copy the widget and services folders from example project to use IjkVideoView widget.

In my another app i didn't pack the ijk jni library and it works. What is this library and what should i do to pack it?

Thanks for your answer.

@martin90s
Copy link

i got same error too!

@martin90s
Copy link

add below in your proguard rules

#ijkplayer
-keep class tv.danmaku.ijk.media.player.** {*; }
-keep class tv.danmaku.ijk.media.player.IjkMediaPlayer{
*;
}
-keep class tv.danmaku.ijk.media.player.ffmpeg.FFmpegApi{
*;
}
it works for me

@enigmadevs
Copy link
Author

Of course! i forgot the fucking proguard. For this reason the exception only appears in release.

Thank you very much!

@yswheye
Copy link

yswheye commented Mar 1, 2017

@martin90s good,it works for me too.

@ahjsrhj
Copy link

ahjsrhj commented Mar 16, 2017

It works for me to, @enigmadevs @xinzhengzhang Why not close this issues?

@enigmadevs
Copy link
Author

Sorry, i forgot it

@gongtingshisi
Copy link

why the the fix can resolve the problem?

@gongtingshisi
Copy link

@martin90s

@fengliangwang
Copy link

@martin90s well done! thanks

@fukemy
Copy link

fukemy commented Sep 24, 2018

how to enable proguard in debug mode?

@Sfourtou
Copy link

Well done thanks !

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

9 participants