Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build issue in dart 3.5.0 - UnmodifiableUint8ListView #263

Closed
hashinclude72 opened this issue Jun 21, 2024 · 121 comments
Closed

build issue in dart 3.5.0 - UnmodifiableUint8ListView #263

hashinclude72 opened this issue Jun 21, 2024 · 121 comments

Comments

@hashinclude72
Copy link

Building package executables... (5.4s)
Failed to build get_cli:get:
../../../.pub-cache/hosted/pub.dev/win32-5.3.0/lib/src/guid.dart:32:9: Error: Type 'UnmodifiableUint8ListView' not found.
  final UnmodifiableUint8ListView bytes;
        ^^^^^^^^^^^^^^^^^^^^^^^^^
../../../.pub-cache/hosted/pub.dev/win32-5.3.0/lib/src/guid.dart:32:9: Error: 'UnmodifiableUint8ListView' isn't a type.
  final UnmodifiableUint8ListView bytes;
        ^^^^^^^^^^^^^^^^^^^^^^^^^
../../../.pub-cache/hosted/pub.dev/win32-5.3.0/lib/src/guid.dart:52:17: Error: Method not found: 'UnmodifiableUint8ListView'.
    return Guid(UnmodifiableUint8ListView(guid));
                ^^^^^^^^^^^^^^^^^^^^^^^^^
../../../.pub-cache/hosted/pub.dev/win32-5.3.0/lib/src/guid.dart:56:31: Error: Method not found: 'UnmodifiableUint8ListView'.
  factory Guid.zero() => Guid(UnmodifiableUint8ListView(Uint8List(16)));
                              ^^^^^^^^^^^^^^^^^^^^^^^^^
../../../.pub-cache/hosted/pub.dev/win32-5.3.0/lib/src/guid.dart:100:17: Error: Method not found: 'UnmodifiableUint8ListView'.
    return Guid(UnmodifiableUint8ListView(Uint8List.fromList(guidAsBytes)));
                ^^^^^^^^^^^^^^^^^^^^^^^^^
                ```
@yanashenyang
Copy link

same same

/../.pub-cache/hosted/pub.dev/win32-5.5.0/lib/src/guid.dart:32:9: Error: Type 'UnmodifiableUint8ListView' not found.
20:46:14 final UnmodifiableUint8ListView bytes;
20:46:14 ^^^^^^^^^^^^^^^^^^^^^^^^^
20:46:19 ../../.pub-cache/hosted/pub.dev/win32-5.5.0/lib/src/guid.dart:32:9: Error: 'UnmodifiableUint8ListView' isn't a type.
20:46:19 final UnmodifiableUint8ListView bytes;
20:46:19 ^^^^^^^^^^^^^^^^^^^^^^^^^
20:46:19 ../../.pub-cache/hosted/pub.dev/win32-5.5.0/lib/src/guid.dart:52:17: Error: Method not found: 'UnmodifiableUint8ListView'.
20:46:19 return Guid(UnmodifiableUint8ListView(guid));
20:46:19 ^^^^^^^^^^^^^^^^^^^^^^^^^
20:46:19 ../../.pub-cache/hosted/pub.dev/win32-5.5.0/lib/src/guid.dart:56:31: Error: Method not found: 'UnmodifiableUint8ListView'.
20:46:19 factory Guid.zero() => Guid(UnmodifiableUint8ListView(Uint8List(16)));
20:46:19 ^^^^^^^^^^^^^^^^^^^^^^^^^
20:46:19 ../../.pub-cache/hosted/pub.dev/win32-5.5.0/lib/src/guid.dart:100:17: Error: Method not found: 'UnmodifiableUint8ListView'.
20:46:19 return Guid(UnmodifiableUint8ListView(Uint8List.fromList(guidAsBytes)));
20:46:19 ^^^^^^^^^^^^^^^^^^^^^^^^^
20:46:24 Target kernel_snapshot_program failed: Exception
20:46:24

@deveshm
Copy link

deveshm commented Jun 28, 2024

This is due to Uint8ListView being deprecated (dart-lang/sdk#45115)

The latest version of win32 package should work though

Try flutter pub upgrade win32

@shubhh123
Copy link

This still isn't solving the issue :(

@deveshm
Copy link

deveshm commented Jul 4, 2024

You can also try switching to stable version of flutter as that is connected to Dart version 3.4.3 currently (whereas master is connected to Dart 3.5.0)

You can switch by running flutter channel stable

@ynhi0711
Copy link

ynhi0711 commented Jul 5, 2024

I've got the same issue, and it has been resolved by switching to the stable channel, flutter channel stable. Thanks @deveshm for your answer

@shubhh123
Copy link

This works!! Thank you very much :)

@sajidshaikh20
Copy link

sajidshaikh20 commented Jul 8, 2024

I've have same issue
follow this step
-- flutter pub cache clean
-- flutter channel stable
-- flutter pub get
so problem has resolved

@PraveenKuamrS
Copy link

Thank you @sajidshaikh20 Your comment was very usefull it was worked
Last 3 hours i spent for this using ai when i search in google i got your answer thank you so much

one request: Pls before post answer mention the error also then everyone will get idea

@adonisRodxander
Copy link

Same problem

@piddval
Copy link

piddval commented Aug 7, 2024

Same problem over here. I've tried steps pointed by [sajidshaikh20] but the problem hasn't been solved

@MelihCevhertas
Copy link

Same problem , not any version downgrade solve this issue

@adonisRodxander
Copy link

This works for me:
1- flutter pub cache clean
2- flutter pub get
3- flutter pub upgrade

@deveshm
Copy link

deveshm commented Aug 7, 2024

The stable version of flutter was updated to dart 3.5.0 today. This means the UnmodifiableUint8ListView breaking change is now in flutter stable.

Ideally any libraries that used this class use the new types

E.g. it looks like the archive package and win32 libraries have already been updated, so you can use the upgrade command above to update it. It looks like there's a fix being worked on for the tflite library

@luckycreationsindia
Copy link

If anyone facing this issue, I did these steps:

  1. flutter pub upgrade win32
  2. flutter clean
  3. flutter pub get
  4. Change NDK version to 26.3.11579264 in build.gradle (Optional)

@ilayda-the-Disc0Queen
Copy link

If anyone facing this issue, I did these steps:

  1. flutter pub upgrade win32
  2. flutter clean
  3. flutter pub get
  4. Change NDK version to 26.3.11579264 in build.gradle (Optional)

Thank you so much @luckycreationsindia, this helped me out after trying everything else in the thread! I left out step 4 but steps 1 - 3 still worked for me. Now I can breathe normally again lol 😂

@ReubenTurner-esusu
Copy link

I am on the latest stable channel, and I am only now encountering this issue. I am not depending on package:win32 at all. I have already done both dart pub cache repair and dart pub cache clean. What else can be done to solve this?

@JulioCRFilho
Copy link

Same here, I'm building for web from a mac and still getting that even without depending on it.

../../.pub-cache/hosted/pub.dev/image_cropper_platform_interface-4.0.0/lib/src/models/cropped_file/html.dart:32:38: Error: The method 'UnmodifiableUint8ListView' isn't defined for the class 'CroppedFile'.

  • 'CroppedFile' is from 'package:image_cropper_platform_interface/src/models/cropped_file/html.dart' ('../../.pub-cache/hosted/pub.dev/image_cropper_platform_interface-4.0.0/lib/src/models/cropped_file/html.dart').
    Try correcting the name to the name of an existing method, or defining a method named 'UnmodifiableUint8ListView'.
    return Future.value(UnmodifiableUint8ListView(_initBytes!));
    ^^^^^^^^^^^^^^^^^^^^^^^^^
    ../../.pub-cache/hosted/pub.dev/archive-3.4.9/lib/src/bzip2/bzip2.dart:5:7: Error: Method not found: 'UnmodifiableUint8ListView'.
    UnmodifiableUint8ListView(Uint8List(0));
    ^^^^^^^^^^^^^^^^^^^^^^^^^
    ../../.pub-cache/hosted/pub.dev/archive-3.4.9/lib/src/bzip2/bzip2.dart:7:7: Error: Method not found: 'UnmodifiableUint32ListView'.
    UnmodifiableUint32ListView(Uint32List(0));
    ^^^^^^^^^^^^^^^^^^^^^^^^^^
    ../../.pub-cache/hosted/pub.dev/archive-3.4.9/lib/src/bzip2/bzip2.dart:9:7: Error: Method not found: 'UnmodifiableInt32ListView'.
    UnmodifiableInt32ListView(Int32List(0));

@ReubenTurner-esusu
Copy link

It appears to be a transient dependency from shared_preferences

@deveshm
Copy link

deveshm commented Aug 7, 2024

The latest version of https://pub.dev/packages/image_cropper_platform_interface is 7.0.0 @JulioCRFilho try upgrading to that, and upgrading your archive package too

@Mohammad-Saidi
Copy link

../../.pub-cache/hosted/pub.dev/win32-5.2.0/lib/src/guid.dart:32:9: Error: Type 'UnmodifiableUint8ListView' not found.
final UnmodifiableUint8ListView bytes;
^^^^^^^^^^^^^^^^^^^^^^^^^
../../.pub-cache/hosted/pub.dev/win32-5.2.0/lib/src/guid.dart:32:9: Error: 'UnmodifiableUint8ListView' isn't a type.
final UnmodifiableUint8ListView bytes;
^^^^^^^^^^^^^^^^^^^^^^^^^
../../.pub-cache/hosted/pub.dev/win32-5.2.0/lib/src/guid.dart:52:17: Error: Method not found: 'UnmodifiableUint8ListView'.
return Guid(UnmodifiableUint8ListView(guid));
^^^^^^^^^^^^^^^^^^^^^^^^^
../../.pub-cache/hosted/pub.dev/win32-5.2.0/lib/src/guid.dart:56:31: Error: Method not found: 'UnmodifiableUint8ListView'.
factory Guid.zero() => Guid(UnmodifiableUint8ListView(Uint8List(16)));
^^^^^^^^^^^^^^^^^^^^^^^^^
../../.pub-cache/hosted/pub.dev/win32-5.2.0/lib/src/guid.dart:100:17: Error: Method not found: 'UnmodifiableUint8ListView'.
return Guid(UnmodifiableUint8ListView(Uint8List.fromList(guidAsBytes)));
^^^^^^^^^^^^^^^^^^^^^^^^^
Target kernel_snapshot_program failed: Exception

FAILURE: Build failed with an exception.

  • What went wrong:
    Execution failed for task ':app:compileFlutterBuildDebug'.

Process 'command '/home/saidi/snap/flutter/common/flutter/bin/flutter'' finished with non-zero exit value 1

@JulioCRFilho
Copy link

JulioCRFilho commented Aug 7, 2024

The latest version of https://pub.dev/packages/image_cropper_platform_interface is 7.0.0 @JulioCRFilho try upgrading to that, and upgrading your archive package too

Thanks, now I'm only getting this:

../../.pub-cache/hosted/pub.dev/archive-3.4.9/lib/src/bzip2/bzip2.dart:5:7: Error: Method not found: 'UnmodifiableUint8ListView'.
      UnmodifiableUint8ListView(Uint8List(0));
      ^^^^^^^^^^^^^^^^^^^^^^^^^
../../.pub-cache/hosted/pub.dev/archive-3.4.9/lib/src/bzip2/bzip2.dart:7:7: Error: Method not found: 'UnmodifiableUint32ListView'.
      UnmodifiableUint32ListView(Uint32List(0));
      ^^^^^^^^^^^^^^^^^^^^^^^^^^
../../.pub-cache/hosted/pub.dev/archive-3.4.9/lib/src/bzip2/bzip2.dart:9:7: Error: Method not found: 'UnmodifiableInt32ListView'.
      UnmodifiableInt32ListView(Int32List(0));
      ^^^^^^^^^^^^^^^^^^^^^^^^^

edit: I've discovered that my problem occurs because excel: 4.0.3 depends on archive: 3.4.9...

@deveshm
Copy link

deveshm commented Aug 7, 2024

Looks like the Excel package already has an open bug for that: justkawal/excel#355

@paulobreim
Copy link

This error is occurring in the stable version that was released yesterday.
It is very difficult to waste time with the nonsense that the Flutter people do.
This error, so far, has no solution, and even if you are not using the Windows version, it gives this error.

@dihsarjr
Copy link

dihsarjr commented Aug 8, 2024

The 'flutter pub upgrade win32' command worked for me.

@farooq958
Copy link

Work Around > Just add directly win32: ^5.5.3 in dependency

@sirkif
Copy link

sirkif commented Aug 8, 2024

I really don't like Flutter because I often find myself trying to fix Flutter or its packages instead of focusing on solving my logic bugs

@JulioCRFilho
Copy link

I really don't like Flutter because I often find myself trying to fix Flutter or its packages instead of focusing on solving my logic bugs

Sounds like you should create your own framework then, since you get to fix Flutter so often

@paraflu
Copy link

paraflu commented Aug 8, 2024

😒 I had the bad idea to update flutter today -_- no more translations !!

@alfietapping
Copy link

Added dependency_overrides: archive: ^3.6.1 win32: ^5.5.3

and it worked

This worked for me

@bentalla108
Copy link

I almost tried all the solutions but it didn't work for me. I freaked out when i tried flutter pub add win32 (from transitive dependency to direct dependency) and it worked as well !

This worked for me

@SaikumarThupakula
Copy link

SaikumarThupakula commented Sep 20, 2024

../../../.pub-cache/hosted/pub.dev/alice-1.0.0-dev.10/lib/ui/calls_list/page/alice_calls_list_page.dart:270:63: Error: The argument type 'String?' can't be assigned to the parameter type 'String' because 'String?' is nullable and 'String' isn't.
OperatingSystem.isAndroid ? OpenFilex.open(result.path) : null,
^
../../../.pub-cache/hosted/pub.dev/alice-1.0.0-dev.10/lib/model/alice_export_result.dart:5:17: Context: 'path' refers to a public property so it couldn't be promoted.

final String? path;
^
../../../.pub-cache/hosted/pub.dev/alice-1.0.0-dev.10/lib/model/alice_export_result.dart:5:17: Context: 'path' couldn't be promoted because field promotion is only available in Dart 3.2 and above.

final String? path;

After upgrading the flutter to latest version and alice package to lastest version

@abisexportsapp
Copy link

archive: ^3.6.1

thanks bro. after struggling so much this worked for me.

@nnadiDivine
Copy link

The latest version of https://pub.dev/packages/image_cropper_platform_interface is 7.0.0 @JulioCRFilho try upgrading to that, and upgrading your archive package too

This was what worked for me all I needed to do was install archive

@budescode
Copy link

win32: ^5.5.3

This worked for me, thanks.

@Ammar7077
Copy link

Ammar7077 commented Oct 2, 2024

$ flutter pub run flutter_launcher_icons:main
OR
$ dart run flutter_launcher_icons:main

My error was:

Deprecated. Use `dart run` instead.
Building package executable... 
Failed to build flutter_launcher_icons:main:
../../../../../.pub-cache/hosted/pub.dev/archive-3.4.10/lib/src/bzip2/bzip2.dart:5:7: Error: Method not found: 'UnmodifiableUint8ListView'.
      UnmodifiableUint8ListView(Uint8List(0));
      ^^^^^^^^^^^^^^^^^^^^^^^^^
../../../../../.pub-cache/hosted/pub.dev/archive-3.4.10/lib/src/bzip2/bzip2.dart:7:7: Error: Method not found: 'UnmodifiableUint32ListView'.
      UnmodifiableUint32ListView(Uint32List(0));
      ^^^^^^^^^^^^^^^^^^^^^^^^^^
../../../../../.pub-cache/hosted/pub.dev/archive-3.4.10/lib/src/bzip2/bzip2.dart:9:7: Error: Method not found: 'UnmodifiableInt32ListView'.
      UnmodifiableInt32ListView(Int32List(0));
      ^^^^^^^^^^^^^^^^^^^^^^^^^

Solution:

I almost tried all these solutions but it didn't work for me.

And my workaround solution was:

  • Open this file: "../../../../../.pub-cache/hosted/pub.dev/archive-3.4.10/lib/src/bzip2/bzip2.dart"
  • Change the code from this:
class BZip2 {
  static final Uint8List emptyUint8List =
      UnmodifiableUint8ListView(Uint8List(0));
  static final Uint32List emptyUint32List =
      UnmodifiableUint32ListView(Uint32List(0));
  static final Int32List emptyInt32List =
      UnmodifiableInt32ListView(Int32List(0));
  ...

To this:

class BZip2 {
static final Uint8List emptyUint8List = Uint8List(0);
  static final Uint32List emptyUint32List = Uint32List(0);
  static final Int32List emptyInt32List = Int32List(0);
  ...

@SukumarRaja
Copy link

SukumarRaja commented Oct 2, 2024 via email

@kananinirav
Copy link

Just update win32 version to the available version in pubspec.lock file. and run flutter pub get

image

@Tarhex
Copy link

Tarhex commented Oct 11, 2024

I did everything but I had no luck. By everything, I mean, I clean the cache, I upgraded flutter, I upgraded win32, I switched to stable channel, I did pub get and upgrade but there was not luck as I was still getting the same error.

What solved the issue for me was to delete the pubspec.lock file and run flutter pub get again.

So, I believe you have to follow the steps posted by others, if it doesn't solve it for you, delete the pubspec.lock file.

@SukumarRaja
Copy link

SukumarRaja commented Oct 11, 2024 via email

@SukumarRaja
Copy link

SukumarRaja commented Oct 11, 2024 via email

@mecidr
Copy link

mecidr commented Oct 22, 2024

Just update win32 version to the available version in pubspec.lock file. and run flutter pub get
image

.lock files are generated automatically and should not be edited. You should instead modify pubspec.yml by adding dependency_overrides: parameter like shown in this comment

@paulobreim
Copy link

I did everything but I had no luck. By everything, I mean, I clean the cache, I upgraded flutter, I upgraded win32, I switched to stable channel, I did pub get and upgrade but there was not luck as I was still getting the same error.

What solved the issue for me was to delete the pubspec.lock file and run flutter pub get again.

So, I believe you have to follow the steps posted by others, if it doesn't solve it for you, delete the pubspec.lock file.

Do it: flutter pub upgrade --major-versions

@saadrasool99
Copy link

build issue in dart 3.5.0 - UnmodifiableUint8ListView

Hi, had same issue, i'm using stripe so I just need to follow these steps to solve my problem.
Step 1: flutter pub cache clean
Step 2: add this in pubspec.yaml
dependency_overrides:
stripe_android: "9.5.0+1"

step 3: flutter pub get

@Angkeasel
Copy link

Angkeasel commented Nov 6, 2024

Added dependency_overrides: archive: ^3.6.1 win32: ^5.5.3

and it worked

it work for me, thanks u

@saadrasool99
Copy link

Hi, @nsanju0413
try to upgrade Dart version (Optional) mostly occur this issue in Dart 3+
Step 1: add dependency_overrides: archive: ^3.6.1 win32: ^5.5.3
Step 2: flutter pub clean
Step 3: flutter pub get

worked for me. thanks

@Barez001159544
Copy link

I did whatever proposed in this thread, alas adding this to pubspec.yaml worked out for me:

dependency_overrides:
intl: "0.17.0"
win32: 5.5.3

@glennmichaelmejias
Copy link

flutter pub add win32

works for me and just delete the win32 dependency in your pubspec.yaml if you dont use it

@SukumarRaja
Copy link

SukumarRaja commented Nov 14, 2024 via email

@BIDIASNOHO
Copy link

I did everything but I had no luck. By everything, I mean, I clean the cache, I upgraded flutter, I upgraded win32, I switched to stable channel, I did pub get and upgrade but there was not luck as I was still getting the same error.

What solved the issue for me was to delete the pubspec.lock file and run flutter pub get again.

So, I believe you have to follow the steps posted by others, if it doesn't solve it for you, delete the pubspec.lock file.

Thanks, it worked for me.

Jacksonm93 added a commit to Jacksonm93/dartTonconnect that referenced this issue Nov 27, 2024
Updated dependencies to overcome an error listed here, 

jonataslaw/get_cli#263
@codepgq
Copy link

codepgq commented Dec 3, 2024

我做了所有事情,但还是没有成功。我所说的所有事情,是指我清理了缓存,升级了 Flutter,升级了 Win32,切换到了稳定频道,执行了 Pub Get 和升级,但还是没有成功,因为仍然出现相同的错误。
对我来说,解决问题的方法是删除 pubspec.lock 文件并flutter pub get再次运行。
因此,我相信您必须按照其他人发布的步骤进行操作,如果它不能为您解决问题,请删除 pubspec.lock 文件。

谢谢,它对我有用。

thanks, worked

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests