wang-bin / fvp

Flutter video player plugin for all desktop+mobile platforms. download prebuilt examples from github actions. https://pub.dev/packages/fvp
BSD 3-Clause "New" or "Revised" License
126 stars 20 forks source link

[android] Text Relocations #23

Closed abdelaziz-mahdy closed 10 months ago

abdelaziz-mahdy commented 10 months ago

this didn't happen to be but a user reported it on android any idea why it may happen? error

Failed to load dynamic library 'libmdk.so': dlopen failed: "/data/app/~~xpBC7GGC939BK6Z_9HGvgA==/com.zezo357.flutter_meedu_videoplayer_example-D0AHtAt6vEZXtTImbY44oA==/lib/x86/libmdk.so" has text relocations (https://android.googlesource.com/platform/bionic/+/master/android-changes-for-ndk-developers.md#Text-Relocations-Enforced-for-API-level-23)

stacktrace

[flutter_meedu_videoplayer] Invalid argument(s): Failed to load dynamic library 'libmdk.so': dlopen failed: "/data/app/~~xpBC7GGC939BK6Z_9HGvgA==/com.zezo357.flutter_meedu_videoplayer_example-D0AHtAt6vEZXtTImbY44oA==/lib/x86/libmdk.so" has text relocations (https://android.googlesource.com/platform/bionic/+/master/android-changes-for-ndk-developers.md#Text-Relocations-Enforced-for-API-level-23)
[flutter_meedu_videoplayer] #0      _open (dart:ffi-patch/ffi_dynamic_library_patch.dart:11:43)
#1      new DynamicLibrary.open (dart:ffi-patch/ffi_dynamic_library_patch.dart:22:12)
#2      Libmdk._load
lib.dart:23
#3      Libmdk.instance
lib.dart:29
#4      Libmdk.instance (package:fvp/src/lib.dart)
lib.dart:1
#5      new Player
player.dart:484
#6      MdkVideoPlayer.create
video_player_mdk.dart:111
#7      VideoPlayerController.initialize
video_player.dart:426
#8      MeeduPlayerController.setDataSource
controller.dart:533
#9      _YoutubeExamplePageState._setDataSource
yotube_page_example.dart:123
#10     _YoutubeExamplePageState._playYoutubeVideo
yotube_page_example.dart:165
                            <asynchronous suspension>
#11     _YoutubeExamplePageState.build.<anonymous closure>.<anonymous closure>
yotube_page_example.dart:258
                            <asynchronous suspension>

[flutter_meedu_videoplayer] Fit is BoxFit.fill.
wang-bin commented 10 months ago

I used a wrong linker flag to build libmdk.so. the error in libmdk.so can be fixed. but libffmpeg.so also has the same issue, which comes from x86 asm code. I don't know x86 asm, it have to be fixed by ffmpeg upstream, maybe I can report the bug. What I can do now for ffmpeg is disable x86 asm, results in worse performance.

abdelaziz-mahdy commented 10 months ago

So we are stuck between reducing performance or not making it work at all😢

Is the performance reduction only on the emulator?

And that only happened after adding x86? It wasn't there before?

wang-bin commented 10 months ago

The latest mdk-sdk should work. only 32bit x86 is affected. btw, 32 bit x86 will be dropped by ndk in the future https://github.com/android/ndk/issues/1772

abdelaziz-mahdy commented 10 months ago

oh i think is fixed then