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

Unable to Run after upgrading flutter to version 3.24 for Android on Windows 11 #153001

Closed
asafgo opened this issue Aug 7, 2024 · 30 comments
Closed
Labels
r: solved Issue is closed as solved

Comments

@asafgo
Copy link

asafgo commented Aug 7, 2024

Steps to reproduce

  1. upgrade flutter to 3.24
  2. open flutter project in vs code
  3. run command: flutter pub upgrade
  4. Run -> Start Debugging

Actual results

/C:/Users/yyyy/AppData/Local/Pub/Cache/hosted/pub.dev/archive-3.4.9/lib/src/bzip2/bzip2.dart:5:7: Error: Method not found: 'UnmodifiableUint8ListView'.
UnmodifiableUint8ListView(Uint8List(0));

Target kernel_snapshot_program failed: Exception

P.S.
Works without any problem when downgrading back to 3.22.3

Logs

Logs
<!-- Paste your logs here -->

Flutter Doctor output

Doctor summary (to see all details, run flutter doctor -v):
[√] Flutter (Channel stable, 3.24.0, on Microsoft Windows [Version 10.0.22631.3958], locale he-IL)
[√] Windows Version (Installed version of Windows is version 10 or higher)
[√] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
[√] Chrome - develop for the web
[√] Visual Studio - develop Windows apps (Visual Studio Enterprise 2022 17.10.5)
[√] Android Studio (version 2023.2)
[√] VS Code (version 1.92.0)
[√] Connected device (4 available)
[√] Network resources

• No issues found!
@Akmalismail
Copy link

This might be related.

I tried the steps here and its fixed

@danagbemava-nc danagbemava-nc added the in triage Presently being triaged by the triage team label Aug 7, 2024
@asafgo
Copy link
Author

asafgo commented Aug 7, 2024

Version 3.24 is stable release?

@danagbemava-nc
Copy link
Member

Hi @asafgo, 3.24 is the newest stable version. What you're facing is likely an issue with your local pub cache.

Can you try clearing your pub cache and then running your project again to see if you still experience this issue? You can clear your pub cache by running flutter pub cache clean.

Please also make sure you the packages you are using are compatible with the latest version of flutter and dart.

Thank you

@danagbemava-nc danagbemava-nc added the waiting for customer response The Flutter team cannot make further progress on this issue until the original reporter responds label Aug 7, 2024
@asafgo
Copy link
Author

asafgo commented Aug 7, 2024

I have already tried flutter pub cache clean but it does not working.
How can I check if packages I am using are compatible with version 3.24 as I have tried to run flutter build apk --debug --verbose but no error from any package.

@github-actions github-actions bot removed the waiting for customer response The Flutter team cannot make further progress on this issue until the original reporter responds label Aug 7, 2024
@ffamar
Copy link

ffamar commented Aug 7, 2024

I have the same issue after upgrading Flutter to 3.24.0. I tried to clear the pub cache, but the error persists.

../../../../.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));
      ^^^^^^^^^^^^^^^^^^^^^^^^^
Target kernel_snapshot_program failed: Exception

@psd24
Copy link

psd24 commented Aug 7, 2024

I have the same error with version 3.24.0.

I have installed version 3.22.3 and it works fine.

I don't know what the problem could be.

@piddval
Copy link

piddval commented Aug 7, 2024

flutter doctor -v
PS C:\Users\piddv\source\repos\prl_chcklst_23> flutter doctor -v
[√] Flutter (Channel stable, 3.24.0, on Microsoft Windows [Versi¢n 10.0.19045.4651], locale es-ES)
• Flutter version 3.24.0 on channel stable at C:\Users\piddv\flutter\flutter_windows_3.3.0-stable\flutter
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision 80c2e84 (8 days ago), 2024-07-30 23:06:49 +0700
• Engine revision b8800d88be
• Dart version 3.5.0
• DevTools version 2.37.2

[√] Windows Version (Installed version of Windows is version 10 or higher)

[√] Android toolchain - develop for Android devices (Android SDK version 32.1.0-rc1)
• Android SDK at C:\Users\piddv\AppData\Local\Android\Sdk
• Platform android-34, build-tools 32.1.0-rc1
• ANDROID_HOME = C:\Users\piddv\AppData\Local\Android\Sdk
• Java binary at: C:\Program Files\Android\Android Studio1\jbr\bin\java
• Java version OpenJDK Runtime Environment (build 17.0.11+0--11852314)
• All Android licenses accepted.

[√] Chrome - develop for the web
• Chrome at C:\Program Files\Google\Chrome\Application\chrome.exe

[√] Visual Studio - develop Windows apps (Visual Studio Community 2022 17.4.4)
• Visual Studio at C:\Program Files\Microsoft Visual Studio\2022\Community
• Visual Studio Community 2022 version 17.4.33213.308
• Windows 10 SDK version 10.0.19041.0

[√] Android Studio (version 2024.1)
• Android Studio at C:\Program Files\Android\Android Studio1
• Flutter plugin can be installed from:
https://plugins.jetbrains.com/plugin/9212-flutter
• Dart plugin can be installed from:
https://plugins.jetbrains.com/plugin/6351-dart
• Java version OpenJDK Runtime Environment (build 17.0.11+0--11852314)

[√] VS Code (version unknown)
• VS Code at C:\Users\piddv\AppData\Local\Programs\Microsoft VS Code
• Flutter extension version 3.94.0
X Unable to determine VS Code version.

[√] Connected device (4 available)
• sdk gphone64 x86 64 (mobile) • emulator-5554 • android-x64 • Android 12 (API 32) (emulator)
• Windows (desktop) • windows • windows-x64 • Microsoft Windows [Versi¢n 10.0.19045.4651]
• Chrome (web) • chrome • web-javascript • Google Chrome 127.0.6533.89
• Edge (web) • edge • web-javascript • Microsoft Edge 127.0.2651.86

[√] Network resources
• All expected network resources are available.

• No issues found!

@adonisRodxander
Copy link

Same problem

@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

@piddval
Copy link

piddval commented Aug 7, 2024

The error I receive is:


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

I have checked the dependencies in my project and the package that seems to depend explicetly on archive 3.4.9 is Excel:

> flutter pub deps
Dart SDK 3.5.0
Flutter SDK 3.24.0
[...]
-- equatable 2.0.5
|   |-- collection...
|   '-- meta...
**|-- excel 4.0.3
|   |-- archive 3.4.9**
|   |   |-- pointycastle 3.9.1
|   |   |   |-- collection...
|   |   |   |-- convert...
|   |   |   '-- js...

In file bzip2.dart in the newest version 3.6.1 the reference to Unmodifiable32List has dissapeared

import 'dart:typed_data';

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

So it seems that the problem in my case is caused by Excel package (https://github.com/justkawal/excel/) depending on an old version of archive

@sajidshaikh20
Copy link

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

@MelihCevhertas
Copy link

The error I receive is:


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

I have checked the dependencies in my project and the package that seems to depend explicetly on archive 3.4.9 is Excel:

> flutter pub deps
Dart SDK 3.5.0
Flutter SDK 3.24.0
[...]
-- equatable 2.0.5
|   |-- collection...
|   '-- meta...
**|-- excel 4.0.3
|   |-- archive 3.4.9**
|   |   |-- pointycastle 3.9.1
|   |   |   |-- collection...
|   |   |   |-- convert...
|   |   |   '-- js...

In file bzip2.dart in the newest version 3.6.1 the reference to Unmodifiable32List has dissapeared

import 'dart:typed_data';

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

So it seems that the problem in my case is caused by Excel package (https://github.com/justkawal/excel/) depending on an old version of archive

I have the same issue about this package. It must be updated to 3.6.1

@asafgo
Copy link
Author

asafgo commented Aug 7, 2024

The error I receive is:


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

I have checked the dependencies in my project and the package that seems to depend explicetly on archive 3.4.9 is Excel:

> flutter pub deps
Dart SDK 3.5.0
Flutter SDK 3.24.0
[...]
-- equatable 2.0.5
|   |-- collection...
|   '-- meta...
**|-- excel 4.0.3
|   |-- archive 3.4.9**
|   |   |-- pointycastle 3.9.1
|   |   |   |-- collection...
|   |   |   |-- convert...
|   |   |   '-- js...

In file bzip2.dart in the newest version 3.6.1 the reference to Unmodifiable32List has dissapeared
import 'dart:typed_data';
class BZip2 { static final Uint8List emptyUint8List = Uint8List(0); static final Uint32List emptyUint32List = Uint32List(0); static final Int32List emptyInt32List = Int32List(0);
So it seems that the problem in my case is caused by Excel package (https://github.com/justkawal/excel/) depending on an old version of archive

I have the same issue about this package. It must be updated to 3.6.1

I can confirm that in my code excel 4.0.3 is using archive 3.4.9 that cause the problem.

@ffamar
Copy link

ffamar commented Aug 7, 2024

In my case, the issue is caused by the pdf package that includes archive 3.4.10.

├── pdf 3.11.0
│   ├── archive 3.4.10
│   │   ├── pointycastle 3.7.4
│   │   │   ├── collection...
│   │   │   ├── convert...
│   │   │   └── js...
│   │   ├── crypto...
│   │   └── path...
│   ├── barcode 2.2.6
│   │   ├── qr 3.0.1
│   │   │   └── meta...
│   │   └── meta...
│   ├── bidi 2.0.10
│   ├── image 4.1.7
│   │   ├── archive...
│   │   ├── meta...
│   │   └── xml...
│   ├── path_parsing 1.0.1
│   │   ├── meta...
│   │   └── vector_math...
│   ├── xml 6.5.0
│   │   ├── petitparser 6.0.2
│   │   │   └── meta...
│   │   ├── collection...
│   │   └── meta...
│   ├── crypto...
│   ├── meta...
│   └── vector_math...

@Trung15010802
Copy link

I have the same issue running 30 minutes but nothing happen

@asafgo
Copy link
Author

asafgo commented Aug 7, 2024

What is working for me, after upgrading to flutter 3.24 is to open pubspec.yaml and downgrade excel package to 4.0.2 like so excel: ^4.0.2 and then add archive 3.6.1 like so archive: ^3.6.1 and save the file so it will update the packages as needed.

Hopefully, https://github.com/justkawal/excel will update excel package to use archive 3.6.1.

@MelihCevhertas
Copy link

I solved the issue with these ;
excel: ^4.0.2
archive: ^3.6.1
And then
dart pub upgrade --major-versions archive

@paulobreim
Copy link

paulobreim commented Aug 8, 2024

This is an error that appeared now with the new version.
Flutter (Channel stable, 3.24.0)
Dart SDK version: 3.5.0 (stable)
This afternoon I compiled my program without any problems. At the end of the day I updated Flutter and Dart and this error started to appear without me having changed anything.
There is nothing to be done, they will have to release a version that corrects this because the error is in their native libs.

I think that the problem is into file .pub-cache/hosted/pub.dev/win32-5.2.0/lib/src/guid.dart.
There has final UnmodifiableUint8ListView bytes; but Idon´t know how to fix it

@darshankawar
Copy link
Member

Based on above comments, it seems to be an issue with third party package excel which needs to update its dependencies to latest so as to be compatible with Flutter's 3.24.0 version.
I will close as it seems to be resolved per OP's comment: #153001 (comment)

Also, track the main issue in dedicated repo: #153001 (comment)

@darshankawar darshankawar added r: solved Issue is closed as solved and removed in triage Presently being triaged by the triage team labels Aug 8, 2024
@RyanTempdrop
Copy link

I think it is more widespread than excel, since I do not use excel

Hw to identify which if any third party is cusing the issue

@asafgo
Copy link
Author

asafgo commented Aug 12, 2024

You can run flutter pub deps and you will see which packages using archive

@RyanTempdrop
Copy link

You can run flutter pub deps and you will see which packages using archive

The only package I have using archive is lottie 3.1.2 , and it is using archive 3.6.1

Could it mean that Archive is not causing this?

@incrediblezayed
Copy link

Add this to your pubspec.yaml, it'll work

dependency_overrides:
  archive: ^3.6.1

@mulderpf
Copy link

mulderpf commented Aug 21, 2024

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

This did not solve the issue for me, I have now downgraded back to Flutter 3.22.3.

After hours - the following worked for me and I am now able to build with Flutter 3.24.0:

dependency_overrides:
  win32: ^5.5.4

@paulobreim
Copy link

Just do it to fix.
flutter pub upgrade --major-versions

@kuanyi0226
Copy link

thank u so much, this works for me!

dependency_overrides:
  archive: ^3.6.1

@Belveloper
Copy link

for my case i managed to fix this by

  1. upgrade to 3.24
  2. update syncfusion package (syncfusion_flutter_sliders package)
  3. flutter pub add win32 (i'm not using this package at all but this fixed the UnmodifiableUint8ListView bug i think you can remove it after you successfully run your project )
  4. flutter channel stable
  5. flutter pub upgrade --major-versions
  6. fix some code errors (some code deprecations )
  7. run

@Belveloper
Copy link

@paulobreim yes this is the key to fix the win32 (UnmodifiableUint8ListView) bug

Copy link

This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 14, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
r: solved Issue is closed as solved
Projects
None yet
Development

No branches or pull requests