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

Flutter 3.0.5 does not compile on file_picker 5.2.8 #1260

Closed
micaelcid opened this issue Apr 12, 2023 · 5 comments · Fixed by #1261
Closed

Flutter 3.0.5 does not compile on file_picker 5.2.8 #1260

micaelcid opened this issue Apr 12, 2023 · 5 comments · Fixed by #1261
Assignees
Labels
new issue An issue that hasn't yet been seen from the maintainer

Comments

@micaelcid
Copy link

micaelcid commented Apr 12, 2023

Currently, we're using Flutter 3.0.5 and as soon as we updated file_picker to 5.2.8, we started getting the following exception while compiling tests or compiling the app itself:

.pub-cache/hosted/pub.dartlang.org/file_picker-5.2.8/lib/src/platform_file.dart:53:9: Error: Type 'Uint8List' not found.
  final Uint8List? bytes;
        ^^^^^^^^^
.pub-cache/hosted/pub.dartlang.org/file_picker-5.2.8/lib/src/platform_file.dart:53:9: Error: 'Uint8List' isn't a type.
  final Uint8List? bytes;

After I manually downgraded this package back to 5.2.7, the compilation error disappeared.

By taking a glance over the change logs, I couldn't find what could cause this issue. Was this problem expected?

@micaelcid micaelcid added the new issue An issue that hasn't yet been seen from the maintainer label Apr 12, 2023
@mateusvtt
Copy link

Having the same issue here

@miguelslemos
Copy link

The issue is related to removed import here 9d1d9ef#diff-38d8f870fecf77b1946a59ac5ed87e3eac24c8a86dc31ec3fd8970896cf8c016L2

@micaelcid
Copy link
Author

Thanks for identifying this up @miguelslemos!

I'm currently using file_picker: '>=5.2.5 <5.2.8' as a workaround until the problem is resolved.

philenius added a commit that referenced this issue Apr 12, 2023
This reverts commit 9d1d9efc3d70385b459d84adb431629f417a33f0i because it caused the errors "Type 'Uint8List' not found" and "Uint8List' isn't a type". Thank you @miguelslemos for identifying the problematic commiti. #1260
@philenius philenius self-assigned this Apr 12, 2023
philenius added a commit that referenced this issue Apr 12, 2023
This reverts commit 9d1d9efc3d70385b459d84adb431629f417a33f0i because it caused the errors "Type 'Uint8List' not found" and "Uint8List' isn't a type". Thank you @miguelslemos for identifying the problematic commit. #1260
philenius added a commit that referenced this issue Apr 12, 2023
This reverts commit 9d1d9ef because it caused the errors "Type 'Uint8List' not found" and "Uint8List' isn't a type". Thank you @miguelslemos for identifying the problematic commit. #1260
@philenius
Copy link
Collaborator

Thank you @miguelslemos for identifying the problematic commit. Turns out, that blindly following the Linter's recommendations, can be dangerous. Sorry for the inconvenience. Will be fixed with file_picker 5.2.9.

@OutdatedGuy
Copy link
Contributor

OutdatedGuy commented Apr 15, 2023

That's interesting, I checked package:flutter/foundation.dart exports and it does export Uint8List from the file src/foundation/serialization.dart as:

export 'dart:typed_data' show ByteData, Endian, Float32List, Float64List, Int32List, Int64List, Uint8List;

weird bug it seems.

https://github.com/flutter/flutter/blob/4543766a1039143f475225adca2afda31b9c7050/packages/flutter/lib/src/foundation/serialization.dart#L8

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
new issue An issue that hasn't yet been seen from the maintainer
Projects
None yet
5 participants