Skip to content
This repository has been archived by the owner on Jan 20, 2023. It is now read-only.

Failed to lookup symbol (dlsym(RTLD_DEFAULT, crypto_box_seedbytes): symbol not found) #39

Closed
nailkhasipov opened this issue Aug 17, 2020 · 13 comments
Assignees
Labels
bug Something isn't working

Comments

@nailkhasipov
Copy link

[VERBOSE-2:ui_dart_state.cc(166)] Unhandled Exception: Invalid argument(s): Failed to lookup symbol (dlsym(RTLD_DEFAULT, crypto_box_seedbytes): symbol not found)
#0 DynamicLibrary.lookup (dart:ffi-patch/ffi_dynamic_library_patch.dart:31:29)
#1 Bindings.lookupSizet (package:flutter_sodium/src/bindings/libsodium.dart:29:14)
#2 new CryptoBoxBindings (package:flutter_sodium/src/bindings/crypto_box_bindings.dart:9:17)
#3 Sodium._cryptoBox (package:flutter_sodium/src/sodium.dart:35:29)
#4 Sodium._cryptoBox (package:flutter_sodium/src/sodium.dart)
#5 Sodium.cryptoBoxPublickeybytes (package:flutter_sodium/src/sodium.dart:190:7)
#6 Sodium.cryptoBoxKeypair (package:flutter_sodium/src/sodium.dart:226:40)
#7 CryptoBox.randomKeys (package:flutter_sodium/src/crypto_box.dart:10:41)
#8 generateKeys (package:vlow/screens/onboarding_screen.dart:171:36)
#9 _OnboardingState.create (package:vlow/screens/onboarding_screen.dart:47:28)
#10 GestureRecognizer.invokeCallbac<…>

Flutter (Channel stable, 1.20.2, on Mac OS X 10.15.6 19G73, locale en-GB)

@soyangel
Copy link

Same error here with Flutter 1.20.2.

It works after downgrading to Flutter 1.17.5.

@kozw kozw added the bug Something isn't working label Aug 18, 2020
@kozw kozw self-assigned this Aug 18, 2020
@rohansingh
Copy link
Contributor

Same issue with Flutter 1.20.2. I won't pretend to understand the underlying issue, but I was able to workaround it by reverting to a pre-FFI revision (0575e58).

@kozw
Copy link
Contributor

kozw commented Aug 20, 2020

Related: flutter/flutter#62853

@soyangel
Copy link

Does the workaround mentioned on flutter/flutter#62853 works with this plugin?

I'm trying with a modified pubspec.yaml including with the "platforms:" section but get the same error.

@kozw
Copy link
Contributor

kozw commented Aug 31, 2020

That issue is definitely related. However the problem is not pubspec.yaml, but the podspec which has changed significantly since Flutter 1.20. Still looking for a solution though.

@vishnukvmd
Copy link

Downgrading Flutter to 1.19.0-4.3.pre solved this for me (I had to say goodbye to a few nice things, but better them than libsodium).

@kozw What is weird is that the example app you've been kind enough to provide works well with Flutter 1.20.4 (stable). But my application freezes with (dlsym(RTLD_DEFAULT, sodium_init): symbol not found). Copying the missing elements from the example's Podfile, did not help.

@kozw
Copy link
Contributor

kozw commented Sep 29, 2020

You most likely get a warning that the Podfile is out of date. When you remove the podfile in example/ios folder, it will be regenerated with something different in flutter 1.20 and you'll get the same error.

It's still a mystery to me would I need to do to fix this.

@kozw kozw closed this as completed in 46d90c5 Sep 29, 2020
@kozw
Copy link
Contributor

kozw commented Sep 29, 2020

Scratch that previous comment. Just had a brainwave and flutter_sodium now seems to work with flutter 1.20.

Please try 0.1.5 available in pub.dev.

@rohansingh
Copy link
Contributor

Hmm, 0.1.5 fails to build on Android:

/Users/rohan/tidbyt/flutter/android/app/src/main/java/io/flutter/plugins/GeneratedPluginRegistrant.java:16: error: cannot find symbol
import com.firstfloorsoftware.flutter_sodium.FlutterSodiumPlugin;
                                            ^
  symbol:   class FlutterSodiumPlugin
  location: package com.firstfloorsoftware.flutter_sodium
/Users/rohan/tidbyt/flutter/android/app/src/main/java/io/flutter/plugins/GeneratedPluginRegistrant.java:46: error: cannot find symbol
    FlutterSodiumPlugin.registerWith(registry.registrarFor("com.firstfloorsoftware.flutter_sodium.FlutterSodiumPlugin"));
    ^
  symbol:   variable FlutterSodiumPlugin
  location: class GeneratedPluginRegistrant
2 errors

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:compileDebugJavaWithJavac'.
> Compilation failed; see the compiler error output for details.

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 51s
Exception: Gradle task assembleDebug failed with exit code 1

@kozw kozw reopened this Sep 30, 2020
@kozw
Copy link
Contributor

kozw commented Sep 30, 2020

My bad, fixed in 0.1.6. All should be good now.

@kozw kozw closed this as completed Sep 30, 2020
@rohansingh
Copy link
Contributor

Just confirming, 0.1.6 works beautifully. Thanks so much!

@kozw
Copy link
Contributor

kozw commented Sep 30, 2020

Good to hear, enjoy!

@nailkhasipov
Copy link
Author

nailkhasipov commented Oct 1, 2020

Also confirmed that 0.1.6 works perfectly with Flutter 1.22.0 beta. Thanks! 🎉

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

5 participants