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

iOS 17: Error while picking LivePhoto in Jpeg format from gallery #1378

Closed
1 of 4 tasks
dmitry-kotorov opened this issue Oct 5, 2023 · 13 comments
Closed
1 of 4 tasks
Labels
help wanted Extra attention is needed iOS Issue applies to iOS platform needs investigation stale

Comments

@dmitry-kotorov
Copy link

dmitry-kotorov commented Oct 5, 2023

When picking a LivePhoto in Jpeg format (created with older versions of iOS) from Gallery the following error occurs:

PlatformException(file_picker_error, Temporary file could not be created, Error Domain=NSItemProviderErrorDomain Code=-1000 "Cannot load representation of type public.item" UserInfo={NSLocalizedDescription=Cannot load representation of type public.item, NSUnderlyingError=0x28335dcb0 {Error Domain=NSCocoaErrorDomain Code=4097 "Couldn’t communicate with a helper application." UserInfo={NSUnderlyingError=0x28335f030 {Error Domain=NSCocoaErrorDomain Code=4097 "connection from pid 859 on anonymousListener or serviceListener" UserInfo={NSDebugDescription=connection from pid 859 on anonymousListener or serviceListener}}}}}, null), #0 StandardMethodCodec.decodeEnvelope (package:flutter/src/services/message_codecs.dart:652:7)
#1 MethodChannel._invokeMethod (package:flutter/src/services/platform_channel.dart:310:18)

#2 MethodChannel.invokeListMethod (package:flutter/src/services/platform_channel.dart:496:35)

#3 FilePickerIO._getPath (package:file_picker/src/file_picker_io.dart:92:33)

Platform

  • Android
  • iOS
  • Web
  • Desktop

Platform OS version
What version did it happen?

17.0.1, 17.0.3, 17.0.3, 17.1

How are you picking?

        final FilePickerResult? result = await FilePicker.platform.pickFiles(
          type: source == ImageSourceChoice.gallery
              ? FileType.image
              : FileType.custom,
          allowedExtensions: source != ImageSourceChoice.gallery
              ? ['jpg', 'jpeg', 'png']
              : null,
          allowMultiple: maxPicturesToTake > 1,
        );

Details to reproduce the issue
On iOS 17 try to pick from gallery and old LivePhoto in Jpeg format (not HEIF)

Error Log
PlatformException(file_picker_error, Temporary file could not be created, Error Domain=NSItemProviderErrorDomain Code=-1000 "Cannot load representation of type public.item" UserInfo={NSLocalizedDescription=Cannot load representation of type public.item, NSUnderlyingError=0x283318120 {Error Domain=NSCocoaErrorDomain Code=4097 "Couldn’t communicate with a helper application." UserInfo={NSUnderlyingError=0x283319410 {Error Domain=NSCocoaErrorDomain Code=4097 "connection from pid 870 on anonymousListener or serviceListener" UserInfo={NSDebugDescription=connection from pid 870 on anonymousListener or serviceListener}}}}}, null), #0 StandardMethodCodec.decodeEnvelope (package:flutter/src/services/message_codecs.dart:652:7)
#1 MethodChannel._invokeMethod (package:flutter/src/services/platform_channel.dart:310:18)

#2 MethodChannel.invokeListMethod (package:flutter/src/services/platform_channel.dart:496:35)

#3 FilePickerIO._getPath (package:file_picker/src/file_picker_io.dart:92:33)

Flutter Version details
[✓] Flutter (Channel stable, 3.13.6, on macOS 13.5.2 22G91 darwin-arm64, locale en-GE)
• Flutter version 3.13.6 on channel stable at /Users/dima/fvm/versions/stable
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision ead455963c (8 days ago), 2023-09-26 18:28:17 -0700
• Engine revision a794cf2681
• Dart version 3.1.3
• DevTools version 2.25.0

[✓] Android toolchain - develop for Android devices (Android SDK version 33.0.1)
• Android SDK at /Users/dima/Library/Android/sdk
• Platform android-33, build-tools 33.0.1
• Java binary at: /Applications/Android Studio.app/Contents/jbr/Contents/Home/bin/java
• Java version OpenJDK Runtime Environment (build 17.0.6+0-17.0.6b829.9-10027231)
• All Android licenses accepted.

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

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

[✓] Android Studio (version 2022.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 17.0.6+0-17.0.6b829.9-10027231)

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

[✓] Connected device (4 available)
• Nobodycries (2) (mobile) • 00008110-000169013609401E • ios • iOS 17.1 21B5056e
• Yan’s iPhone (mobile) • 00008030-001879CE1E69802E • ios • iOS 16.6.1 20G81
• macOS (desktop) • macos • darwin-arm64 • macOS 13.5.2 22G91 darwin-arm64
• Chrome (web) • chrome • web-javascript • Google Chrome 117.0.5938.132

[✓] Network resources
• All expected network resources are available.

@dmitry-kotorov dmitry-kotorov added the new issue An issue that hasn't yet been seen from the maintainer label Oct 5, 2023
@squaredx
Copy link

squaredx commented Oct 5, 2023

We're also experiencing this issue on iOS 17 with JPEG live photos. Live photos using HEIC are working as expected.

@github-actions
Copy link

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

@github-actions github-actions bot added the stale label Oct 13, 2023
@miguelpruivo miguelpruivo added help wanted Extra attention is needed needs investigation iOS Issue applies to iOS platform and removed new issue An issue that hasn't yet been seen from the maintainer stale labels Oct 16, 2023
@miguelpruivo
Copy link
Owner

It's important to understand what might have been changed in the iOS SDK that could result in this.

@loonix
Copy link

loonix commented Oct 17, 2023

@dmitry-kotorov are you able to share the image that creates that issue? I have a customer that has this issue and I am unable to reproduce it. Would be good for us to investigate why it is happening and maybe have a handler for it.

@dmitry-kotorov
Copy link
Author

@loonix I don't know how to do this. As soon as I try to share it turns into a JPEG or MOV file. Here it is: https://images.getwardrobe.com/static/test/IMG_8955.mov

@squaredx
Copy link

squaredx commented Oct 17, 2023

Not sure if it's related but I found a similar issue on the Apple developer forums here https://developer.apple.com/forums/thread/737014

I was able to replicate the issue by going into the Camera section of the iOS Setting app and switching the device to shoot in "most compatible" instead of "most efficient". Then go into the camera and take a Live Photo. The resulting pic should replicate this issue >50% of the time.

@loonix
Copy link

loonix commented Oct 18, 2023

I managed to reproduce it now, its definitely the live photo creating this issue, will give you more information as soon as I debug this issue.

@loonix
Copy link

loonix commented Oct 18, 2023

Yeah it is like you say it does not happen every time @squaredx, I think that apple forum is spot on.

@Jacqqq
Copy link

Jacqqq commented Oct 20, 2023

100% reproducible, (you need 2 iphones with iCloud sync)
steps:

  • take a live heif photo on one iphone,
  • wait until it uploads it to iCloud
  • try the filePicker on this file on another iPhone when the thumbnail appears, but the file is not downloaded yet

Temporary workaround: I am displaying a snack to go to gallery, display and try again as it'll work back again when it's downloaded

@luandnguyen
Copy link

luandnguyen commented Oct 20, 2023

I can reproduce this 100% by simply changing the camera format to "Most Compatible" which will produce a JPEG image. Then turn on Live Photo and take the photo.

Using an iOS 17 device, I received the error. But on devices < iOS 17, the photo works.

Summary:

  • iOS 17 works: HEIF live / not-live, JPEG not-live
  • iOS < 17 works: HEIF live / not-live, JPEG live / not-live

@github-actions
Copy link

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

@github-actions github-actions bot added the stale label Oct 28, 2023
Copy link

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

@loonix
Copy link

loonix commented Nov 17, 2023

Anyone found what this was? I still didn't had time to debug it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed iOS Issue applies to iOS platform needs investigation stale
Projects
None yet
Development

No branches or pull requests

6 participants