syncfusion / flutter-widgets

Syncfusion Flutter widgets libraries include high quality UI widgets and file-format packages to help you create rich, high-quality applications for iOS, Android, and web from a single code base.
1.46k stars 680 forks source link

after update pdfviewer package to 20.2.48-beta, error occurred #878

Closed sejun2 closed 1 year ago

sejun2 commented 1 year ago

[Error ...]

../../../.pub-cache/hosted/pub.dartlang.org/syncfusion_flutter_pdfviewer-20.2.48-beta/lib/src/common/pdf_provider.dart:18:10: Error: Type 'Uint8List' not found. Future getPdfBytes(BuildContext context); ^^^^^^^^^ ../../../.pub-cache/hosted/pub.dartlang.org/syncfusion_flutter_pdfviewer-20.2.48-beta/lib/src/common/pdf_provider.dart:46:3: Error: Type 'Uint8List' not found. Uint8List? _documentBytes; ^^^^^^^^^ ../../../.pub-cache/hosted/pub.dartlang.org/syncfusion_flutter_pdfviewer-20.2.48-beta/lib/src/common/pdf_provider.dart:49:10: Error: Type 'Uint8List' not found. Future getPdfBytes(BuildContext context) async { ^^^^^^^^^ ../../../.pub-cache/hosted/pub.dartlang.org/syncfusion_flutter_pdfviewer-20.2.48-beta/lib/src/common/pdf_provider.dart:74:13: Error: Type 'Uint8List' not found. MemoryPdf(Uint8List bytes) { ^^^^^^^^^ ../../../.pub-cache/hosted/pub.dartlang.org/syncfusion_flutter_pdfviewer-20.2.48-beta/lib/src/common/pdf_provider.dart:78:8: Error: Type 'Uint8List' not found. late Uint8List _pdfBytes; ^^^^^^^^^ ../../../.pub-cache/hosted/pub.dartlang.org/syncfusion_flutter_pdfviewer-20.2.48-beta/lib/src/common/pdf_provider.dart:81:10: Error: Type 'Uint8List' not found. Future getPdfBytes(BuildContext context) async { ^^^^^^^^^ ../../../.pub-cache/hosted/pub.dartlang.org/syncfusion_flutter_pdfviewer-20.2.48-beta/lib/src/common/pdf_provider.dart:106:3: Error: Type 'Uint8List' not found. Uint8List? _documentBytes; ^^^^^^^^^ ../../../.pub-cache/hosted/pub.dartlang.org/syncfusion_flutter_pdfviewer-20.2.48-beta/lib/src/common/pdf_provider.dart:109:10: Error: Type 'Uint8List' not found. Future getPdfBytes(BuildContext context) async { ^^^^^^^^^ ../../../.pub-cache/hosted/pub.dartlang.org/syncfusion_flutter_pdfviewer-20.2.48-beta/lib/src/common/pdf_provider.dart:140:3: Error: Type 'Uint8List' not found. Uint8List? _documentBytes; ^^^^^^^^^ ../../../.pub-cache/hosted/pub.dartlang.org/syncfusion_flutter_pdfviewer-20.2.48-beta/lib/src/common/pdf_provider.dart:143:10: Error: Type 'Uint8List' not found. Future getPdfBytes(BuildContext context) async { ^^^^^^^^^ ../../../.pub-cache/hosted/pub.dartlang.org/syncfusion_flutter_pdfviewer-20.2.48-beta/lib/src/common/pdfviewer_plugin.dart:21:23: Error: Type 'Uint8List' not found. CancelableOperation<Uint8List?>? _nativeImage; ^^^^^^^^^ ../../../.pub-cache/hosted/pub.dartlang.org/syncfusion_flutter_pdfviewer-20.2.48-beta/lib/src/common/pdfviewer_plugin.dart:24:37: Error: Type 'Uint8List' not found. Future initializePdfRenderer(Uint8List documentBytes) async { ^^^^^^^^^ ../../../.pub-cache/hosted/pub.dartlang.org/syncfusion_pdfviewer_platform_interface-20.2.48-beta/lib/src/method_channel_pdfviewer.dart:12:7: Error: Type 'Uint8List' not found. Uint8List documentBytes, String documentID) async { ^^^^^^^^^ ../../../.pub-cache/hosted/pub.dartlang.org/syncfusion_pdfviewer_platform_interface-20.2.48-beta/lib/src/method_channel_pdfviewer.dart:33:10: Error: Type 'Uint8List' not found. Future<Uint8List?> getImage( ^^^^^^^^^ ../../../.pub-cache/hosted/pub.dartlang.org/syncfusion_flutter_pdfviewer-20.2.48-beta/lib/src/common/pdf_provider.dart:46:3: Error: 'Uint8List' isn't a type. Uint8List? _documentBytes; ^^^^^^^^^ ../../../.pub-cache/hosted/pub.dartlang.org/syncfusion_flutter_pdfviewer-20.2.48-beta/lib/src/common/pdf_provider.dart:58:19: Error: 'Uint8List' isn't a type. return Future.value(_documentBytes); ^^^^^^^^^ ../../../.pub-cache/hosted/pub.dartlang.org/syncfusion_flutter_pdfviewer-20.2.48-beta/lib/src/common/pdf_provider.dart:74:13: Error: 'Uint8List' isn't a type. MemoryPdf(Uint8List bytes) { ^^^^^^^^^ ../../../.pub-cache/hosted/pub.dartlang.org/syncfusion_flutter_pdfviewer-20.2.48-beta/lib/src/common/pdf_provider.dart:78:8: Error: 'Uint8List' isn't a type. late Uint8List _pdfBytes; ^^^^^^^^^ ../../../.pub-cache/hosted/pub.dartlang.org/syncfusion_flutter_pdfviewer-20.2.48-beta/lib/src/common/pdf_provider.dart:82:19: Error: 'Uint8List' isn't a type. return Future.value(_pdfBytes); ^^^^^^^^^ ../../../.pub-cache/hosted/pub.dartlang.org/syncfusion_flutter_pdfviewer-20.2.48-beta/lib/src/common/pdf_provider.dart:106:3: Error: 'Uint8List' isn't a type. Uint8List? _documentBytes; ^^^^^^^^^ ../../../.pub-cache/hosted/pub.dartlang.org/syncfusion_flutter_pdfviewer-20.2.48-beta/lib/src/common/pdf_provider.dart:120:19: Error: 'Uint8List' isn't a type. return Future.value(_documentBytes); ^^^^^^^^^ ../../../.pub-cache/hosted/pub.dartlang.org/syncfusion_flutter_pdfviewer-20.2.48-beta/lib/src/common/pdf_provider.dart:140:3: Error: 'Uint8List' isn't a type. Uint8List? _documentBytes; ^^^^^^^^^ ../../../.pub-cache/hosted/pub.dartlang.org/syncfusion_flutter_pdfviewer-20.2.48-beta/lib/src/common/pdf_provider.dart:151:19: Error: 'Uint8List' isn't a type. return Future.value(_documentBytes); ^^^^^^^^^ ../../../.pub-cache/hosted/pub.dartlang.org/syncfusion_flutter_pdfviewer-20.2.48-beta/lib/src/common/pdfviewer_plugin.dart:21:23: Error: 'Uint8List' isn't a type. CancelableOperation<Uint8List?>? _nativeImage; ^^^^^^^^^ ../../../.pub-cache/hosted/pub.dartlang.org/syncfusion_flutter_pdfviewer-20.2.48-beta/lib/src/common/pdfviewer_plugin.dart:24:37: Error: 'Uint8List' isn't a type. Future initializePdfRenderer(Uint8List documentBytes) async { ^^^^^^^^^ ../../../.pub-cache/hosted/pub.dartlang.org/syncfusion_flutter_pdfviewer-20.2.48-beta/lib/src/common/pdfviewer_plugin.dart:70:42: Error: 'Uint8List' isn't a type. _nativeImage = CancelableOperation<Uint8List?>.fromFuture( ^^^^^^^^^ ../../../.pub-cache/hosted/pub.dartlang.org/syncfusion_flutter_pdfviewer-20.2.48-beta/lib/src/common/pdfviewer_plugin.dart:73:14: Error: 'Uint8List' isn't a type. Future<Uint8List?> imageFuture = _nativeImage!.value.whenComplete(() { ^^^^^^^^^ ../../../.pub-cache/hosted/pub.dartlang.org/syncfusion_flutter_pdfviewer-20.2.48-beta/lib/src/common/pdfviewer_plugin.dart:77:22: Error: 'Uint8List' isn't a type. final Future<Uint8List?> image = imageFuture; ^^^^^^^^^ ../../../.pub-cache/hosted/pub.dartlang.org/syncfusion_flutter_pdfviewer-20.2.48-beta/lib/src/common/pdfviewer_plugin.dart:85:13: Error: 'Uint8List' isn't a type. final Uint8List? image = await imageFuture; ^^^^^^^^^ ../../../.pub-cache/hosted/pub.dartlang.org/syncfusion_flutter_pdfviewer-20.2.48-beta/lib/src/common/pdfviewer_plugin.dart:88:40: Error: The getter 'Uint8List' isn't defined for the class 'PdfViewerPlugin'.

Shahed-Atik commented 1 year ago

up!

deepika134 commented 1 year ago

Hi Sejun,

kindly upgrade to the latest version of Flutter SDK to get the issue resolved. Please try this and let us know if the issue is resolved or not. Flutter SDK setup link for the latest version: https://docs.flutter.dev/get-started/install/windows#get-the-flutter-sdk

Regards, Deepika Ravi

JonathanAwma commented 1 year ago

up! Both with latest versions.

chornthorn commented 1 year ago

I have the same problem.

Test1990143 commented 1 year ago

Import Missing: import 'dart:typed_data'; Files : pdf_provider pdfviewer_plugin method_channel_pdfviewer

sejun2 commented 1 year ago

Sorry for not attach to detailed description for my error. After doing update flutter version to 3.3.0, then I updated sf pdfviewer package. But my flutter project has some packages that are incompatible for 3.3.0 flutter version, so I have no choice but to downgrade flutter version. After that, this error happend. I tried everything, including deleting and repair cache directory, but it didn't work. I hope this description helps you solving this problem. Thank you

JonathanAwma commented 1 year ago

To which version did you downgrade bro, I downgraded to 2.10.3, still errors cannot run.

sejun2 commented 1 year ago

To which version did you downgrade bro, I downgraded to 2.10.3, still errors cannot run.

In my case, 3.0.5

sejun2 commented 1 year ago

Hi Sejun,

kindly upgrade to the latest version of Flutter SDK to get the issue resolved. Please try this and let us know if the issue is resolved or not. Flutter SDK setup link for the latest version: https://docs.flutter.dev/get-started/install/windows#get-the-flutter-sdk

Regards, Deepika Ravi

yes after updating to latest version, it works. But after that doing downgrade flutter version, then such erorrs happen. And please my error description comment. Thank you

deepika134 commented 1 year ago

Hi sejun,

To use the latest (syncfusion_flutter_pdfviewer: ^20.2.48-beta) Syncfusion flutter PdfViewer package, you need to update to the latest Flutter SDK . If you are unable update to the latest Flutter SDK, kindly downgrade the Syncfusion flutter PdfViewer package version to lesser than v20.2.46, but it does not support the latest features.

Regards, Deepika Ravi

sejun2 commented 1 year ago

This error happens when I downgrade flutter version.

In my pubspec.yaml syncfusion_flutter_pdfviewer: 20.2.48-beta # pdf viewer => syncfusion_flutter_pdfviewer: 20.2.46-beta # pdf viewer

I did everything including deleting ,repairing cache, pub get and pub clean, but it spit such error. Please check again, some users have same error as you can see the comments.

deepika134 commented 1 year ago

Hi @sejun2 ,

Kindly confirm that you have downgraded the following dependent PDFViewer packages to version 20.2.46-beta.

  1. syncfusion pdfviewer platform interface
  2. syncfusion pdfviewer web
  3. syncfusion pdfviewer macos
  4. syncfusion pdfviewer windows

Regards, Deepika Ravi

michael-woolsey commented 1 year ago

For clarification, in my pubspec when I did this, I was able to get it to work with the downgraded version:

syncfusion_flutter_pdfviewer: 20.2.46-beta syncfusion_pdfviewer_platform_interface: 20.2.46-beta syncfusion_flutter_core: 20.2.46 syncfusion_pdfviewer_web: 20.2.46-beta syncfusion_pdfviewer_windows: 20.2.46-beta syncfusion_pdfviewer_macos: 20.2.46-beta

corymalcolmtaylor commented 1 year ago

I am running Flutter v 2.8.1 and so far have tried all syncfusion_flutter_pdfviewer versions from the latest to as low as 20.2.44-beta but still I get this error:

Launching lib/main.dart on iPhone 8 in debug mode...
lib/main.dart:1
Xcode build done.                                           20.7s
Failed to build iOS app
Error output from Xcode build:
↳
    ** BUILD FAILED **
Xcode's output:
↳
: Error: Type 'Uint8List' not found.
../…/src/pdfviewer.dart:235
        Uint8List bytes, {
        ^^^^^^^^^
: Error: Type 'Uint8List' not found.
../…/src/pdfviewer.dart:851
      CancelableOperation<Uint8List>? _getPdfFileCancellableOperation;
                          ^^^^^^^^^

Is there version of syncfusion_flutter_pdfviewer that will work with flutter v 2.8.1 on iOS, Android and Web?

sejun2 commented 1 year ago

@deepika134 It works fine now. Thank you for your great solution.