merigo-labs / solana-web3

MIT License
9 stars 6 forks source link

Build Failure: UnmodifiableUint8ListView Method Not Found #15

Open Gajjar-Mohit opened 1 month ago

Gajjar-Mohit commented 1 month ago

When using the pinenacl package version 0.5.1 with the current Dart SDK, a build error occurs due to the method UnmodifiableUint8ListView not being found. This issue appears to be related to changes in the Dart SDK where this class is no longer available.

Steps to Reproduce:

  1. Add pinenacl: ^0.5.1 to pubspec.yaml.
  2. Run flutter pub get or flutter build.
  3. Observe the following error:

    Error: Method not found: 'UnmodifiableUint8ListView'.

Expected Behavior:

The project should build without any errors.

Actual Behavior:

The build fails with the UnmodifiableUint8ListView error.

Temporary Solution:

Updating the pinenacl dependency to version 0.6.0 resolves this issue.

Proposed Fix:

Consider updating the dependency in the project to pinenacl: ^0.6.0 to avoid this error for users.

Environment:

Additional Context:

The issue may be due to changes in how Dart handles unmodifiable views in newer versions. Upgrading to pinenacl version 0.6.0 is recommended to resolve this issue.

derFunk commented 1 week ago

Same:

../../../../../../.pub-cache/hosted/pub.dev/pinenacl-0.5.1/lib/api/api.dart:90:12: Error: Method not found: 'UnmodifiableUint8ListView'.
    return UnmodifiableUint8ListView(Uint8List.fromList(data.toList()));
           ^^^^^^^^^^^^^^^^^^^^^^^^^
Target kernel_snapshot_program failed: Exception

FAILURE: Build failed with an exception.

flutter doctor:

flutter doctor
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 3.24.3, on macOS 14.6.1 23G93 darwin-arm64, locale en-DE)
[✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
[✓] Xcode - develop for iOS and macOS (Xcode 15.4)
[✓] Android Studio (version 2024.1)
[✓] VS Code (version 1.93.0)
[✓] Connected device (2 available)
[✓] Network resources

• No issues found!

Please update dependency to pinenacl updated to 0.6.0 and create a new version of solana_web3.

There's a PR already: https://github.com/merigo-labs/solana-web3/pull/14