CaiJingLong / flutter_ijkplayer

ijkplayer for flutter
MIT License
791 stars 149 forks source link

Android release包运行时闪退[Need help] #184

Open Jarvan1997 opened 4 years ago

Jarvan1997 commented 4 years ago

Android release包运行时闪退 debug包没问题 报错为: E/flutter (29758): [ERROR:flutter/shell/platform/android/platform_view_android_jni.cc(39)] java.lang.UnsatisfiedLinkError: JNI_ERR returned from JNI_OnLoad in "/data/app/com.njmw.video-PMaYqmQTN_pQsyXLX2A8CA==/lib/arm/libijksdl.so" E/flutter (29758): at java.lang.Runtime.loadLibrary0(Runtime.java:1071) E/flutter (29758): at java.lang.Runtime.loadLibrary0(Runtime.java:1007) E/flutter (29758): at java.lang.System.loadLibrary(System.java:1668) E/flutter (29758): at tv.danmaku.ijk.media.player.g.a(:1) E/flutter (29758): at tv.danmaku.ijk.media.player.IjkMediaPlayer.a(:8) E/flutter (29758): at h.a.a.n.a(:2) E/flutter (29758): at d.a.b.a.m$a.a(:2) E/flutter (29758): at io.flutter.embedding.engine.a.c.a(:14) E/flutter (29758): at io.flutter.embedding.engine.FlutterJNI.handlePlatformMessage(:2) E/flutter (29758): at android.os.MessageQueue.nativePollOnce(Native Method) E/flutter (29758): at android.os.MessageQueue.next(MessageQueue.java:363) E/flutter (29758): at android.os.Looper.loop(Looper.java:173) E/flutter (29758): at android.app.ActivityThread.main(ActivityThread.java:8147) E/flutter (29758): at java.lang.reflect.Method.invoke(Native Method) E/flutter (29758): at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:513) E/flutter (29758): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1101) E/flutter (29758): F/flutter (29758): [FATAL:flutter/shell/platform/android/platform_view_android_jni.cc(76)] Check failed: CheckException(env).

befovy commented 4 years ago

禁止混淆 ijkplayer 相关的 java 类就行了

https://fijkplayer.befovy.com/docs/zh/faq.html

KignorChan commented 4 years ago

这个问题解决了吗?我遇到同样的问题。

Jarvan1997 commented 4 years ago

这个问题解决了吗?我遇到同样的问题。

看楼上大佬的回复 禁止混淆 ijkplayer 相关的 java 类就行了 在 proguard 文件加入 -keep class tv.danmaku.ijk.media.player.* { ; } 另外楼上大佬的fijkplayer也挺好用的 可以看一下

KignorChan commented 4 years ago

谢谢回答。我的项目里没有找到proguard文件,我要创建一个吗?我的项目使用flutter V1.17.4 创建的。对安卓这块不是很懂。

KignorChan commented 4 years ago

@Jarvan1997 问题解决了,谢谢!

cn-Meepo commented 3 years ago

@KignorChan 请问怎么解决的?