mikeperri / flutter_sequencer

A Flutter plugin for music sequencing.
Other
90 stars 38 forks source link

Failed to lookup symbol (dlsym(RTLD_DEFAULT, RegisterDart_PostCObject): symbol not found) #8

Closed Ryan4CN closed 3 years ago

Ryan4CN commented 3 years ago

This is a great plugin. I encountered this error when I tried to extract the released version. It only works in debug and profile mode

[VERBOSE-2:ui_dart_state.cc(177)] Unhandled Exception: Invalid argument(s): Failed to lookup symbol (dlsym(RTLD_DEFAULT, RegisterDart_PostCObject): symbol not found)
#0      DynamicLibrary.lookup (dart:ffi-patch/ffi_dynamic_library_patch.dart:31)
#1      nRegisterPostCObject (package:flutter_sequencer/native_bridge.dart)
#2      nRegisterPostCObject (package:flutter_sequencer/native_bridge.dart)
#3      NativeBridge.doSetup (package:flutter_sequencer/native_bridge.dart:101)
<asynchronous suspension>
#4      GlobalState._setupEngine (package:flutter_sequencer/global_state.dart:121)
<asynchronous suspension>
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 1.22.5, on Mac OS X 10.15.7 19H2 darwin-x64, locale zh-Hans-CN)

[!] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
    ! Some Android licenses not accepted.  To resolve this, run: flutter doctor --android-licenses
[✓] Xcode - develop for iOS and macOS (Xcode 12.3)
[!] Android Studio (version 4.1)
    ✗ Flutter plugin not installed; this adds Flutter specific functionality.
    ✗ Dart plugin not installed; this adds Dart specific functionality.
[✓] VS Code (version 1.52.1)
[✓] Connected device (3 available)

I tried some solutions, but still can't solve this problem.

In Xcode, go to Target Runner > Build Settings > Strip Style. Change from All Symbols to Non-Global Symbols.

111coding commented 3 years ago

I solved it this way. This way works fine in the release version.

1.In Xcode, go to Target Runner > Build Settings > Strip Style => Non-Global Symbols 2.enable testability => YES

mikeperri commented 3 years ago

This should be fixed in 0.1.4. The solution is @111coding 's, I just put it in the podspec file so you don't have to make the change manually. Thanks for opening an issue about this.