tmthecoder / dargon2

Argon2 Dart Bindings
https://docs.tmthecoder.dev/dargon2/
MIT License
18 stars 12 forks source link

Unhandled Exception: Invalid argument(s): Failed to lookup symbol (dlsym(RTLD_DEFAULT, argon2_hash): symbol not found) #2

Open seekcx opened 3 years ago

seekcx commented 3 years ago

Great library, thank you for your contribution.

I encountered the following error when using it, what should I do?

Unhandled Exception: Invalid argument(s): Failed to lookup symbol (dlsym(RTLD_DEFAULT, argon2_hash): symbol not found)
#0      DynamicLibrary.lookup (dart:ffi-patch/ffi_dynamic_library_patch.dart:31:29)
#1      new LocalBinder._
package:dargon2/…/native/local_binder.dart:154
#2      LocalBinder._privateInstance
package:dargon2/…/native/local_binder.dart:127
#3      LocalBinder._privateInstance (package:dargon2/src/native/local_binder.dart)
package:dargon2/…/native/local_binder.dart:1
#4      LocalBinder.instance
package:dargon2/…/native/local_binder.dart:144
#5      DArgon2.hashPasswordBytesSync
package:dargon2/src/argon2.dart:156
#6      DArgon2.hashPasswordStringSync
package:dargon2/src/argon2.dart:123
#7      DArgon2.hashPasswordString
package:dargon2/src/argon2.dart:66
#8      RootController.make
package:elf/…/controller/root.dart:56
#9      _InkResponseState._handleTap
package:flutter/…/material/ink_well.dart:989
#10     GestureRecognizer.invokeCallback
package:flutter/…/gestures/recognizer.dart:182
#11     TapGestureRecognizer.handleTapUp
package:flutter/…/gestures/tap.dart:607
#12     BaseTapGestureRecognizer._checkUp
package:flutter/…/gestures/tap.dart:296
#13     BaseTapGestureRecognizer.acceptGesture
package:flutter/…/gestures/tap.dart:267
#14     GestureArenaManager.sweep
package:flutter/…/gestures/arena.dart:157
#15     GestureBinding.handleEvent
package:flutter/…/gestures/binding.dart:443
#16     GestureBinding.dispatchEvent
package:flutter/…/gestures/binding.dart:419
#17     RendererBinding.dispatchEvent
package:flutter/…/rendering/binding.dart:287
#18     GestureBinding._handlePointerEventImmediately
package:flutter/…/gestures/binding.dart:374
#19     GestureBinding.handlePointerEvent
package:flutter/…/gestures/binding.dart:338
#20     GestureBinding._flushPointerEventQueue
package:flutter/…/gestures/binding.dart:296
#21     GestureBinding._handlePointerDataPacket
package:flutter/…/gestures/binding.dart:279
#22     _rootRunUnary (dart:async/zone.dart:1370:13)
#23     _CustomZone.runUnary (dart:async/zone.dart:1265:19)
#24     _CustomZone.runUnaryGuarded (dart:async/zone.dart:1170:7)
#25     _invoke1 (dart:ui/hooks.dart:182:10)
#26     PlatformDispatcher._dispatchPointerDataPacket (dart:ui/platform_dispatcher.dart:282:7)
#27     _dispatchPointerDataPacket (dart:ui/hooks.dart:96:31)
tmthecoder commented 3 years ago

Hey, what platform are you trying to run on and are you using this plugin or the dargon2_flutter plugin?

It seems like you have a flutter app. If so, you should be using the dargon2_flutter plugin as the normal C library loading doesn't work with mobile devices and flutter apps need to handle library loading differently.

tmthecoder commented 3 years ago

Closing due to inactivity. Please reopen if needed

ThamMK commented 2 years ago

Hey @tmthecoder, thanks a lot for the library but I am also facing the same error when building to the iOS simulator running on MacOS using Visual Studio Code. The same code works on Windows for the Android simulator but I'm getting this error message on the MacOS.

Here is my flutter doctor flutter doctor macos

Thank you!

tmthecoder commented 2 years ago

@ThamMK What is the deploy platform? Are you deploying to macOS or building an iOS app on a Mac device? Either way, the plugin should be supported on all platforms. If you encounter a lookup error, try initializing it like it mentions on the README for the isolate-specific initialization or the pre Flutter 2.8

ThamMK commented 2 years ago

I am building a flutter 3.0 app onto the iPhone simulator on a Mac device. I have tried initializing at the main function but I'm still getting the error.

flutter3_dargon2_error

tmthecoder commented 2 years ago

Is this app using Swift or Objective C?

ThamMK commented 2 years ago

It's using Swift

tmthecoder commented 2 years ago

If you build for Android on that same Mac, does it work?

tmthecoder commented 2 years ago

@ThamMK I was able to reproduce this after a bit of messing with Flutter & iOS Apps. I found the issue to be weird since it wasn't present prior to Flutter 3.

Though, my fix was adding: pod 'Argon2Swift' then running a flutter pub get and cd ios && pod install. Can you verify that works for you?

ThamMK commented 2 years ago

Thanks for the fix, I'll give it a try when I have the chance to test it out as at the moment we have switched to a different argon2 package.

tmthecoder commented 2 years ago

@ThamMK Any word on this? I'll close if not.

the-recondite commented 2 years ago

@tmthecoder Works for me

wbusey0 commented 6 months ago

Works for me as well. Maybe this should be added to the installation instructions?