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

Android and iOS Build Failure ( The getter 'COINIT' isn't defined for the class 'FilePickerWindows') #1531

Closed
jwogan5 opened this issue Jun 13, 2024 · 10 comments · Fixed by #1530
Labels
new issue An issue that hasn't yet been seen from the maintainer stale

Comments

@jwogan5
Copy link

jwogan5 commented Jun 13, 2024

Issue:
When trying to build the app for iOS and Android mobile the following errors are happening with file_picker 8.0.5.

../../.pub-cache/hosted/pub.dev/file_picker-8.0.5/lib/src/windows/file_picker_windows.dart:98:7: Error: The getter 'COINIT' isn't defined for the class 'FilePickerWindows'.

A few more undefined variables are found in this same file.

Platform

  • [ X ] Android
  • [ X ] iOS

Platform OS version
What version did it happen?
file_picker 8.0.5

Flutter Version details
Flutter: 3.22.2

@jwogan5 jwogan5 added the new issue An issue that hasn't yet been seen from the maintainer label Jun 13, 2024
@Exusai
Copy link

Exusai commented Jun 13, 2024

I have the same issue, when trying to build for android:

Launching lib\main.dart on sdk gphone x86 in debug mode...
../../../AppData/Local/Pub/Cache/hosted/pub.dev/file_picker-8.0.5/lib/src/windows/file_picker_windows.dart:98:7: Error: The getter 'COINIT' isn't defined for the class 'FilePickerWindows'.
 - 'FilePickerWindows' is from 'package:file_picker/src/windows/file_picker_windows.dart' ('../../../AppData/Local/Pub/Cache/hosted/pub.dev/file_picker-8.0.5/lib/src/windows/file_picker_windows.dart').
Try correcting the name to the name of an existing getter, or defining a getter or field named 'COINIT'.
      COINIT.COINIT_APARTMENTTHREADED | COINIT.COINIT_DISABLE_OLE1DDE,
      ^^^^^^
../../../AppData/Local/Pub/Cache/hosted/pub.dev/file_picker-8.0.5/lib/src/windows/file_picker_windows.dart:98:41: Error: The getter 'COINIT' isn't defined for the class 'FilePickerWindows'.
 - 'FilePickerWindows' is from 'package:file_picker/src/windows/file_picker_windows.dart' ('../../../AppData/Local/Pub/Cache/hosted/pub.dev/file_picker-8.0.5/lib/src/windows/file_picker_windows.dart').
Try correcting the name to the name of an existing getter, or defining a getter or field named 'COINIT'.
      COINIT.COINIT_APARTMENTTHREADED | COINIT.COINIT_DISABLE_OLE1DDE,
                                        ^^^^^^
../../../AppData/Local/Pub/Cache/hosted/pub.dev/file_picker-8.0.5/lib/src/windows/file_picker_windows.dart:139:36: Error: The getter 'WIN32_ERROR' isn't defined for the class 'FilePickerWindows'.
 - 'FilePickerWindows' is from 'package:file_picker/src/windows/file_picker_windows.dart' ('../../../AppData/Local/Pub/Cache/hosted/pub.dev/file_picker-8.0.5/lib/src/windows/file_picker_windows.dart').
Try correcting the name to the name of an existing getter, or defining a getter or field named 'WIN32_ERROR'.
      if (hr == HRESULT_FROM_WIN32(WIN32_ERROR.ERROR_CANCELLED)) {
                                   ^^^^^^^^^^^
Target kernel_snapshot failed: Exception


FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:compileFlutterBuildDevDebug'.
> Process 'command 'C:\src\flutter\bin\flutter.bat'' finished with non-zero exit value 1

and building for IOS:

Failed to build iOS app
Could not build the precompiled application for the device.
Error (Xcode): ../../../.pub-cache/hosted/pub.dev/file_picker-8.0.5/lib/src/windows/file_picker_windows.dart:98:7: Error: The getter 'COINIT' isn't defined for the class 'FilePickerWindows'.
2
Error launching application

@ladonskliarov
Copy link

I have the same on iOS

@DennisKragekjaer
Copy link

Same here

@navaronbracke
Copy link
Collaborator

What version of win32 are you using? One of the deprecations was flagged in win32 version 5.4.0

https://pub.dev/packages/win32/changelog#540

@DennisKragekjaer
Copy link

@navaronbracke It solved my issue by adding
win32: ^5.5.1 to pubspec.yaml
a dependency I wasn't explicitly using before. Shouldnt that be a dependency of file_picker?

@navaronbracke
Copy link
Collaborator

It is a dependency: https://github.com/miguelpruivo/flutter_file_picker/blob/master/pubspec.yaml#L18

We might need to bump the win32 version though...

@navaronbracke
Copy link
Collaborator

Included the version bump in #1530

Copy link

This issue is stale because it has been open for 7 days with no activity.

@github-actions github-actions bot added the stale label Jun 23, 2024
MrCyjaneK pushed a commit to MrCyjaneK/unnamed_monero_wallet that referenced this issue Jun 29, 2024
MrCyjaneK added a commit to MrCyjaneK/unnamed_monero_wallet that referenced this issue Jun 29, 2024
MrCyjaneK added a commit to MrCyjaneK/unnamed_monero_wallet that referenced this issue Jun 29, 2024
@Bostigger
Copy link

You can use this version for now
file_picker: ^7.0.0

@pierre-juarez
Copy link

The problem is still present
file_picker: ^8.0.5

I downgraded to v. 7.0.0.0.

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 stale
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants