miguelpruivo / flutter_file_picker

File picker plugin for Flutter, compatible with mobile (iOS & Android), Web, Desktop (Mac, Linux, Windows) platforms with Flutter Go support.
MIT License
1.32k stars 653 forks source link

[iOS] Picking live photos not properly working on iOS 17. #1367

Closed GabrielAraujo closed 11 months ago

GabrielAraujo commented 1 year ago

Recently taken or older from iCloud live photos, are failing to load the file representation using public.item UTI type on iOS 17 Beta.

Platform

Platform OS version iOS 17

How are you picking?

final pickerResult = await FilePicker.platform.pickFiles(
          type: MediaType.image,
          allowMultiple: true,
          allowCompression: true,
        );

Details to reproduce the issue

  1. Take live photos
  2. Try to select those from your app
  3. Process fails and exception is returned

Error Log

***** Could not load the picked given file: Error Domain=NSItemProviderErrorDomain Code=-1000 "Cannot load representation of type public.item" UserInfo={NSLocalizedDescription=Cannot load representation of type public.item, NSUnderlyingError=0x28282de30 {Error Domain=NSCocoaErrorDomain Code=4097 "Couldn’t communicate with a helper application." UserInfo={NSUnderlyingError=0x2829c7540 {Error Domain=NSCocoaErrorDomain Code=4097 "connection from pid 1220 on anonymousListener or serviceListener" UserInfo={NSDebugDescription=connection from pid 1220 on anonymousListener or serviceListener}}}}}

Flutter Version details

[!] Flutter (Channel unknown, 3.7.8, on macOS 13.5.1 22G90 darwin-arm64, locale en-BR)
    ! Flutter version 3.7.8 on channel unknown at /Users/gabrielaraujo/fvm/versions/3.7.8
      Currently on an unknown channel. Run `flutter channel` to switch to an official channel.
      If that doesn't fix the issue, reinstall Flutter by following instructions at https://flutter.dev/docs/get-started/install.
    ! Unknown upstream repository.
      Reinstall Flutter by following instructions at https://flutter.dev/docs/get-started/install.
    • Framework revision 90c64ed42b (6 months ago), 2023-03-21 11:27:08 -0500
    • Engine revision 9aa7816315
    • Dart version 2.19.5
    • DevTools version 2.20.1
    • If those were intentional, you can disregard the above warnings; however it is recommended to use "git" directly to perform update checks and upgrades.

[!] Android toolchain - develop for Android devices (Android SDK version 33.0.1)
    • Android SDK at /Users/gabrielaraujo/Library/Android/sdk
    • Platform android-33, build-tools 33.0.1
    • ANDROID_HOME = /Users/gabrielaraujo/Library/Android/sdk
    • Java binary at: /Applications/Android Studio.app/Contents/jre/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 11.0.13+0-b1751.21-8125866)
    ✗ Android license status unknown.
      Run `flutter doctor --android-licenses` to accept the SDK licenses.
      See https://flutter.dev/docs/get-started/install/macos#android-setup for more details.

[✓] Xcode - develop for iOS and macOS (Xcode 14.3.1)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Build 14E300c
    • CocoaPods version 1.12.1

[✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 2021.3)
    • Android Studio at /Applications/Android Studio.app/Contents
    • 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 11.0.13+0-b1751.21-8125866)

[✓] VS Code (version 1.81.1)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.72.0

[✓] Connected device (3 available)
    • SM G990E (mobile) • RQCTA013LRL • android-arm64  • Android 13 (API 33)
    • macOS (desktop)   • macos       • darwin-arm64   • macOS 13.5.1 22G90 darwin-arm64
    • Chrome (web)      • chrome      • web-javascript • Google Chrome 116.0.5845.179
    ! Error: Could not locate device support files. You may be able to resolve the issue by installing the latest version of Xcode from the Mac App Store or developer.apple.com.

      [missing string: 869a8e318f07f3e2f42e11d435502286094f76de] (code 2)

[✓] HTTP Host Availability
    • All required HTTP hosts are available

Additional context I've replaced the public.item to public.image on loadFileRepresentationForTypeIdentifier and it seems to work just fine. Also found this thread that had a similar issue, I've posted there too but it is still under review.

GabrielAraujo commented 1 year ago

Maybe we could think on using the type parameter also on the didFinishPicking method to use public.image or public.audiovisual-content as per this documentation depending on the selected media type.

github-actions[bot] commented 12 months ago

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

github-actions[bot] commented 11 months ago

This issue was closed because it has been inactive for 14 days since being marked as stale.