DavBfr / dart_pdf

Pdf creation module for dart/flutter
https://pub.dev/packages/pdf
Apache License 2.0
1.42k stars 633 forks source link

Incompatibility with Flutter 3.24.0 #1711

Open ffamar opened 3 months ago

ffamar commented 3 months ago

After upgrading Flutter to version 3.24.0, there is an incompatibility with archive 3.4.10 included by the latest pdf package. It seems that the latest version of the archive package has solved this issue. Probably, a new version of the pdf package is necessary.

The build error:

../../../../.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

The dependencies:

├── 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 commented 3 months ago

+1 Check PR

1712

najibkr commented 3 months ago

Facing the same issue...

Please, upgrade image and archive package dependencies to the latest versions.

/~/.pub-cache/hosted/pub.dev/archive-3.1.1/lib/src/bzip2/bzip2.dart:9:7: Error: Method not found: 'UnmodifiableInt32ListView'. UnmodifiableInt32ListView(Int32List(0));

ps6067966 commented 3 months ago

/C:/Users/ps606/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));

Same issue. +1

hwkim1127 commented 3 months ago

yup same here

VikramPandianK commented 3 months ago

../../../../.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)); ^^^^^^^^^^^^^^^^^^^^^^^^^ same here

DavBfr commented 3 months ago

Update to the latest version of the pdf library, it's compatible with the latest Flutter version.

mshabacus commented 3 months ago

Update to the latest version of the pdf library, it's compatible with the latest Flutter version.

only if you update dependenciìy archive-3.4.10 to archive-3.5.0 or later

ffamar commented 3 months ago

Any news on the new version?

ffamar commented 3 months ago

Update to the latest version of the pdf library, it's compatible with the latest Flutter version.

The latest version of the PDF Library still includes the archive 3.4.10.

mshabacus commented 3 months ago

if you want to update flutter and dependencies for now you should modify the library and import it as a package via assets (I solved it like this while waiting for an official update). For example:

pdf:  path: ./assets/packages/pdf-3.11.1-custom

rakib205 commented 2 months ago

temporary fix

dependency_overrides: archive: ^3.6.1

gitslav commented 1 month ago

@DavBfr just to ping you about this as it is reproducible with Flutter 3.24. If anyone has this issue just check the above solution provided by @rakib205