dint-dev / cryptography

Cryptography for Flutter developers: encryption, digital signatures, key agreement, etc.
https://pub.dev/packages/cryptography
Apache License 2.0
161 stars 83 forks source link

WASM Compatibilty #187

Open redDwarf03 opened 3 months ago

redDwarf03 commented 3 months ago

With flutter web 3.22, it isn't possible to build app with flutter build web --wasmcommand because of this error

Target dart2wasm failed: ProcessException: Process exited abnormally with exit code 64:
*NOTE*: Compilation to WasmGC is experimental.
The support may change, or be removed, with no advance notice.

../../../flutter/.pub-cache/hosted/pub.dev/ffi-2.1.2/lib/src/allocation.dart:5:1: Error: 'dart:ffi' can't be imported when compiling to Wasm.
import 'dart:ffi';
^
../../../flutter/.pub-cache/hosted/pub.dev/ffi-2.1.2/lib/src/utf16.dart:5:1: Error: 'dart:ffi' can't be imported when compiling to Wasm.
import 'dart:ffi';
^
../../../flutter/.pub-cache/hosted/pub.dev/ffi-2.1.2/lib/src/utf8.dart:6:1: Error: 'dart:ffi' can't be imported when compiling to Wasm.
import 'dart:ffi';
^
../../../flutter/.pub-cache/hosted/pub.dev/ffi-2.1.2/lib/src/arena.dart:8:1: Error: 'dart:ffi' can't be imported when compiling to Wasm.
import 'dart:ffi';
^
../../../flutter/.pub-cache/hosted/pub.dev/cryptography-2.7.0/lib/src/dart/argon2_impl_vm.dart:16:1: Error: 'dart:ffi' can't be imported when compiling to Wasm.
import 'dart:ffi';
sunderee commented 2 days ago

This is also briefly mentioned in this PR as well. Migration to WASM would require some changes.