Skip to content

FvpPlugin: static initializer: loadLibrary fvp_plugin error: java.lang.UnsatisfiedLinkError: dlopen failed: cannot locate symbol "_ZNSt6__ndk122__libcpp_verbose_abortEPKcz" #358

Open

Description

@Koenger

Describe the bug

使用 flutter create -t module my_flutter指令创建一个flutter module,添加了fvp插件,开发完成后,使用
dependencies {
debugImplementation
'com.example.flutter_module:flutter_debug:1.0'
profileImplementation
'com.example.flutter_module:flutter_profile:1.0'
releaseImplementation
'com.example.flutter_module:flutter_release:1.0'
}
添加到现有的原生Android项目中,项目能正常运行,但是打开播放器时,提示:
W FvpPlugin: static initializer: loadLibrary fvp_plugin error: java.lang.UnsatisfiedLinkError: dlopen failed: cannot locate symbol "_ZNSt6__ndk122__libcpp_verbose_abortEPKcz" referenced by "/data/app/~~TRCjrQeEUfjy8xmfDeH5yA==/com.tech.module-_Pjup2dJiB5DKjFCDDNj9w==/lib/arm64/libfvp_plugin.so"...
播放失败,这是什么原因;

Expected behavior

项目能正常运行,正常播放视频

Log

Add

import 'package:fvp/fvp.dart' as fvp;

add the following lines before registerWith()

 fvp.registerWith(
    options: {
      'platforms': ['ios', 'android'],
      'video.decoders': ['FFmpeg'], // FFmpeg、AMediaCodec、MediaCodec
      'lowLatency':
          1, // 减少延时,这里有说明:https://github.com/wang-bin/mdk-sdk/issues/347
    },
  );

and

W FvpPlugin: static initializer: loadLibrary fvp_plugin error: java.lang.UnsatisfiedLinkError: dlopen failed: cannot locate symbol "_ZNSt6__ndk122__libcpp_verbose_abortEPKcz" referenced by "/data/app/~~TRCjrQeEUfjy8xmfDeH5yA==/com.tech.module-_Pjup2dJiB5DKjFCDDNj9w==/lib/arm64/libfvp_plugin.so"...
[✓] Flutter (Channel stable, 3.29.2, on macOS 15.6.1 24G90 darwin-arm64,
    locale zh-Hans-CN)
[!] Android toolchain - develop for Android devices (Android SDK version
    35.0.0)
    ! Some Android licenses not accepted. To resolve this, run: flutter doctor
      --android-licenses
[!] Xcode - develop for iOS and macOS (Xcode 16.3)
    ! CocoaPods 1.15.2 out of date (1.16.2 is recommended).
        CocoaPods is a package manager for iOS or macOS platform code.
        Without CocoaPods, plugins will not work on iOS or macOS.
        For more info, see https://flutter.dev/to/platform-plugins
      To update CocoaPods, see
      https://guides.cocoapods.org/using/getting-started.html#updating-cocoapo
      ds
[✓] Chrome - develop for the web
[✓] Android Studio (version 2023.3)
[✓] VS Code (version 1.122.0)
[✓] Connected device (4 available)

Activity

  1. wang-bin commented on Jun 1, 2026

    @wang-bin
    Owner

    因为编译libfvp_plugin.so的libc++版本高,打包的libc++版本低于17。一个办法是打包用到的最新的libc++或者统一版本,另一个办法是引入兼容代码 https://github.com/wang-bin/cppcompat/blob/master/src/libcxx_verbose_abort.cpp

  2. Koenger commented on Jun 2, 2026

    @Koenger
    Author

    libc++ 版本相同了,但是提示了Unhandled Exception: Invalid argument(s): Failed to load dynamic library 'libfvp_plugin.so': dlopen failed: cannot locate symbol "_ZNSt6__ndk122__libcpp_verbose_abortEPKcz" referenced by "/data/app/~~7_69Ba6JxMnRAGtmH9-z1w==/com.tech.module-u4MBB0uoa5F-R79ELC5jww==/lib/arm64/libfvp_plugin.so"...

    E flutter : #0 _open (dart:ffi-patch/ffi_dynamic_library_patch.dart:11:43)
    E flutter : #1 new DynamicLibrary.open (dart:ffi-patch/ffi_dynamic_library_patch.dart:22:12)
    E flutter : #2 Libfvp._load (package:fvp/src/lib.dart:52:29)
    E flutter : #3 Libfvp.instance (package:fvp/src/lib.dart:58:27)
    E flutter : #4 Libfvp.instance (package:fvp/src/lib.dart)
    E flutter : #5 Libfvp.registerType (package:fvp/src/lib.dart:68:31)
    E flutter : #6 Libfvp.registerType (package:fvp/src/lib.dart)
    E flutter : #7 new _GlobalCallbacks (package:fvp/src/global.dart:264:12)
    E flutter : #8 _GlobalCallbacks.instance (package:fvp/src/global.dart:260:38)
    E flutter : #9 _GlobalCallbacks.instance (package:fvp/src/global.dart)
    E flutter : #10 setLogHandler (package:fvp/src/global.dart:252:20)
    E flutter : #11 MdkVideoPlayerPlatform._setupMdk (package:fvp/src/video_player_mdk.dart:211:9)
    E flutter : #12 MdkVideoPlayerPlatform.registerVideoPlayerPlatformsWith. (package:fvp/src/video_player_mdk.dart:203:7)
    E flutter : #13 new Future.delayed. (dart:async/future.dart:422:42)
    E flutter : #14 Timer._createTimer. (dart:async-patch/timer_patch.dart:18:15)
    E flutter : #15 _Timer._runTimers (dart:isolate-patch/timer_impl.dart:410:19)
    E flutter : #16 _Timer._handleMessage (dart:isolate-patch/timer_impl.dart:441:5)
    E flutter : #17 _RawReceivePort._handleMessage (dart:isolate-patch/isolate_patch.dart:194:12)

  3. wang-bin commented on Jun 2, 2026

    @wang-bin
    Owner

    上传一份编译日志和apk我看看

  4. Koenger commented on Jun 2, 2026

    @Koenger
    Author
  5. wang-bin commented on Jun 2, 2026

    @wang-bin
    Owner

    要完整的编译日志,可以用命令行重定向到文件,ide里可能显示不全

  6. wang-bin commented on Jul 15, 2026

    @wang-bin
    Owner

    /oc explain this issue

  7. opencode-agent commented on Jul 15, 2026

    @opencode-agent

    Issue Explanation

    Error: libfvp_plugin.so fails to load because it references __libcpp_verbose_abort, a symbol that doesn't exist in the libc++ runtime bundled in the APK.

    Root Cause — C++ ABI mismatch across NDK versions

    The symbol _ZNSt6__ndk122__libcpp_verbose_abortEPKcz (demangled: std::__ndk1::__libcpp_verbose_abort(char const*, ...)) was introduced in NDK r26+'s libc++. The fvp plugin compiles against this newer libc++ (the prebuilt mdk-sdk-android.7z is built with it), but the consuming Android app ships an older version of libc++_shared.so — likely from an older NDK or a dependency that bundles a stale copy.

    Since the project uses c++_shared STL (android/build.gradle:63), all native libraries share a single libc++_shared.so. If any library in the APK drags in an older copy, the linker resolves to that older copy, and __libcpp_verbose_abort is missing → dlopen fails.

    The Maintainer's Recommended Fixes

    1. Unify libc++ version — ensure every native library in the APK uses the same NDK version and that the newest libc++_shared.so wins. In the consumer app's build.gradle:

      android {
          packagingOptions {
              pickFirst '**/libc++_shared.so'
          }
      }
    2. Add a compatibility shim — compile libcxx_verbose_abort.cpp into libfvp_plugin.so as a stub. This provides a no-op definition of the symbol so the linker doesn't need it from libc++. This is the lower-friction fix for end users who can't control all native dependencies in their app.

    New%20session%20-%202026-07-15T08%3A17%3A17.128Z
    opencode session  |  github run

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions