Comments (1)
SodiumPlatform.instance
is initialized automatically by flutter when the plugin is loaded. This happens as part of the WidgetsBinding.ensureInitialized()
in normal code. This is not automatically executed when launching a new isolate, thus it does not get initialized. It did work with older versions, as back then flutter did not support loading dart plugins automatically.
This is not a bug, but expected behaviour. You have to do one of the following things to use the plugin in a different isolate:
- Simply call
WidgetsBinding.ensureInitialized()
in your Isolate - Use a plugin like flutter_isolate that takes care of that for you.
- Manually initialize the instance. This requires you to now which platform you are on and select the correct implementation. See https://github.com/Skycoder42/libsodium_dart_bindings/tree/main/packages/sodium_libs/lib/src/platforms where you can find the concrete implementations. For example, to initialize it for Android, you could call
SodiumAndroid.registerWith()
.
from libsodium_dart_bindings.
Related Issues (20)
- iOS: Failed to lookup symbol 'sodium_init' HOT 6
- SecretStream Push Decryption HOT 1
- [sodium_libs] `LateInitializationError` if initialize in `compute` Isolate. How to use package with `compute` correctly? HOT 8
- Removal of pwhash means this is no longer libsodium HOT 3
- sodium.js - Cannot read properties of undefined (reading 'then') HOT 5
- Speed of sodium.crypto.secretBox.easy() etc... HOT 4
- Implement crypto_stream_xchacha20 HOT 1
- FFI failure or SodiumInit timing problem? HOT 9
- Flutter_test Failed to lookup symbol 'sodium_init' HOT 9
- Create `Sodium.runIsolated` method to easily run computation heavy cryptographic operations in an isolate HOT 12
- How does one use AES-GCM? HOT 12
- Request for SecretStream encryption/decryption example HOT 7
- Sodium.runIsolated breaking flutter run build HOT 2
- build failure: libsodium.so not found on latest update HOT 4
- Implement cryptoSignEd25519SkToSeed (crypto_sign_ed25519_sk_to_seed) HOT 8
- Use chacha20poly1305 instead of xchacha20poly1305_ietf HOT 2
- Secret stream state initialization; Continue interrupted upload of encrypted stream; HOT 3
- How update flutter_sodium 0.2.0 to sodium_libs? HOT 3
- How to create a shared secret using Scalarmult? HOT 6
- Fails to build on Fedora HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from libsodium_dart_bindings.