8000 Image picker freezes on ios 18 simulator. (maybe on real device as well) · Issue #155401 · flutter/flutter · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Image picker freezes on ios 18 simulator. (maybe on real device as well) #155401

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

Closed
Lazizbek97 opened this issue Sep 19, 2024 · 41 comments
Closed
Assignees
Labels
e: OS-version specific Affects only some versions of the relevant operating system fyi-ecosystem For the attention of Ecosystem team p: image_picker The Image Picker plugin. package flutter/packages repository. See also p: labels. platform-ios iOS applications specifically r: invalid Issue is closed as not valid team-ios Owned by iOS platform team waiting for customer response The Flutter team cannot make further progress on this issue until the original reporter responds

Comments

@Lazizbek97
Copy link
Lazizbek97 commented Sep 19, 2024

Steps to reproduce

  1. Upgraded Flutter to latest version: 3.24.3
  2. upgraded xcode and simulators for IOS 18.0
    once app successfully run, while selecting images from gallery, it is freezing.
    App itself works as usual, no problem. But image picker screen freezes on top of it. you cannot cancel or close it. One way is kill the app, and run it again.

Expected results

It should work as before.

Actual results

Simulator Screenshot - iPhone 16 Pro - 2024-09-19 at 17 36 44

Here is how it is acting.

Code sample

Code sample
[Paste your code here]

Screenshots or Video

Screenshots / Video demonstration

[Upload media here]

Logs

Logs
[Paste your logs here]

Flutter Doctor output

Doctor output
flutter doctor
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 3.24.3, on macOS 15.0 24A335 darwin-arm64, locale en-UZ)
[✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
[✓] Xcode - develop for iOS and macOS (Xcode 16.0)
[✓] Chrome - develop for the web
[✓] Android Studio (version 2023.1)
[✓] IntelliJ IDEA Ultimate Edition (version 2024.1)
[✓] VS Code (version 1.93.1)
[✓] Connected device (6 available)
[✓] Network resources

• No issues found!
@danagbemava-nc danagbemava-nc added the in triage Presently being triaged by the triage team label Sep 19, 2024
@danagbemava-nc
Copy link
Member

Hi @Lazizbek97, I just tested the image_picker sample app in the iOS 18 simulator and it works as expected. See the recording below. Do you experience the same with the example app? If not, can you provide a complete minimal reproducible code sample so that we can properly investigate this? Thank you

Screen.Recording.2024-09-19.at.12.46.48.PM.mov

@danagbemava-nc danagbemava-nc added the waiting for customer response The Flutter team cannot make further progress on this issue until the original reporter responds label Sep 19, 2024
@gulmensedat
Copy link

I have the same problem #155402

@danagbemava-nc
Copy link
Member

Hi @gulmensedat, do you get this in a new app or only in your actual project? If it is only in your actual project, can you provide a minimal sample so that we can properly investigate this?

@gulmensedat
Copy link
gulmensedat commented Sep 19, 2024
 try {
          ImagePicker imagePicker = ImagePicker();
          var xfile = await imagePicker.pickImage(
                                     source: ImageSource.gallery);
    } catch(e){
         print("error $e");
 }

Ekran Resmi 2024-09-19 17 06 42

danagbemava-nc It has a cut off image like this. I tried 2 emulators, same problem. This is the latest version of xcode from the appstore. This screen opens and stays like this, I cannot click anything.

@hughesyadaddy
Copy link

Same issue as well.

@Lazizbek97
Copy link
Author

i have run the app on real ios device, and xcode console shows following error:
[ERROR] Could not create a bookmark: NSError: Cocoa 4097 "connection to service named com.apple.FileProvider" [ERROR] Could not create a bookmark: NSError: Cocoa 4099 "The connection to service named com.apple.FileProvider was invalidated from this process."

but it is working, no freezes

@github-actions github-actions bot removed the waiting for customer response The Flutter team cannot make further progress on this issue until the original reporter responds label Sep 20, 2024
@danagbemava-nc
Copy link
Member

Hi @gulmensedat, I just tested again on two simulators and it works as expected in both cases. See the recording below.

I do see the same error shared by @Lazizbek97 in #155401 (comment) with both the simulator and my physical device but it works as expected on all devices tested so far. I don't get the seemingly out of place image picker sheet.

To everyone facing this issue with the simulator, can you try running the app from Xcode to see if you get any errors?

Screen.Recording.2024-09-20.at.6.10.32.AM.mov

@danagbemava-nc danagbemava-nc added the waiting for customer response The Flutter team cannot make further progress on this issue until the original reporter responds label Sep 20, 2024
@gulmensedat
Copy link

Hi @gulmensedat, I just tested again on two simulators and it works as expected in both cases. See the recording below.

I do see the same error shared by @Lazizbek97 in #155401 (comment) with both the simulator and my physical device but it works as expected on all devices tested so far. I don't get the seemingly out of place image picker sheet.

To everyone facing this issue with the simulator, can you try running the app from Xcode to see if you get any errors?

Screen.Recording.2024-09-20.at.6.10.32.AM.mov

I restarted my macbook and tried from xcode, the problem is the same. Is your Xcode version the latest in the appstore or beta?

@danagbemava-nc
Copy link
Member

Hi @gulmensedat, I'm using the latest stable Xcode version, not a beta version. Did you see any errors in Xcode?

[✓] Xcode - develop for iOS and macOS (Xcode 16.0)
    • Xcode at /Applications/Xcode-16.0.0.app/Contents/Developer
    • Build 16A242d
    • CocoaPods version 1.15.2

@gulmensedat
Copy link

Hi @gulmensedat, I'm using the latest stable Xcode version, not a beta version. Did you see any errors in Xcode?

[✓] Xcode - develop for iOS and macOS (Xcode 16.0)
    • Xcode at /Applications/Xcode-16.0.0.app/Contents/Developer
    • Build 16A242d
    • CocoaPods version 1.15.2

Very interesting, I mean it's a serious problem but you don't have the problem, I and others have it too. I don't know how we can solve it. In fact, there are people who have this problem on the react-native side, it's basically the same function anyway. The number of people who have this problem is constantly increasing. We've been waiting for an update for days, some people downgraded to xcode15 and there was no problem there.

react-native-image-picker/react-native-image-picker#2312

@danagbemava-nc
< 8000 /summary> Copy link
Member

@gulmensedat, thanks for the link. This seems like there might be a general issue with iOS 18.

Labeling for further investigation as I cannot reproduce this at the moment.

cc @stuartmorgan

@danagbemava-nc danagbemava-nc added p: image_picker The Image Picker plugin. package flutter/packages repository. See also p: labels. e: OS-version specific Affects only some versions of the relevant operating system fyi-ecosystem For the attention of Ecosystem team team-ios Owned by iOS platform team platform-ios iOS applications specifically and removed waiting for customer response The Flutter team cannot make further progress on this issue until the original reporter responds in triage Presently being triaged by the triage team labels Sep 20, 2024
@1990jmirandar
Copy link

hello, its happening in Xcode 16 too with a simulator iPhone 16

@Joyce-Hz
Copy link

Hello, has anyone solved this problem? Can you provide me with a solution? I have also encountered this problem, which is invalid when selecting photos. The same problem occurs in both iPhone and iPad. First, when the picture selection is opened, there is a picture displayed in the top left corner, but I cannot click the picture and close the picture window. Then click the button again, the window will pop up in the middle of reality, but when the picture selection pops up, it cannot load the picture, and it is always in the loading picture
Snipaste_2024-09-23_15-32-37
Snipaste_2024-09-23_15-33-10

@creativecreatorormaybenot
Copy link
Contributor

Happens on an iPhone 16 Pro Simulator running iOS 18.0.

@christopherfujino

This comment was marked as spam.

@grenager
Copy link

I'm seeing the same problem, but only when I run on iOS 18. When I run on iOS 17.6.1 (my physical iPhone 14) there's no problem.

@hughesyadaddy
Copy link

The issue seems to happen when arm64 is excluded for simulator. Just delete arm64 from Runner -> build settings -> Excluded Architectures

This worked for me :)

@jmagman
Copy link
Member
jmagman commented 8000 Sep 25, 2024

The issue seems to happen when arm64 is excluded for simulator. Just delete arm64 from Runner -> build settings -> Excluded Architectures

Well that explains why it's not reproducing from the image_picker example app. You are likely using a plugin that does not work on arm64 simulators, so on an Apple Silicon Mac it's running the simulator in Rosetta.

This is another manifestation of Rosetta simulators having weird bugs, like #79641 and #93177.

@Lazizbek97 can you check if any of your plugins have arm64 excluded? See #79641 (comment) for how to do this.

@jmagman jmagman added the waiting for customer response The Flutter team cannot make further progress on this issue until the original reporter responds label Sep 25, 2024
@abhinand-kv
Copy link

I encountered the same issue on our real device and was able to reproduce it twice, though the cause remains unclear.

@jmagman
Copy link
Member
jmagman commented Oct 1, 2024

@abhinand-kv That's concerning. If you can give any hint of how to reproduce it on a real device that would be very helpful.

@Fairfieldfred
Copy link
Fairfieldfred commented Oct 1, 2024

I have an app which relies heavily on Google ML Kit which is in fact the only packages in the app which don't support arm64 (thank you @Lazizbek97 for your tip above). So that stinks for me. What I don't understand is why image_picker does work in iOS 17.6 simulators but not iOS 18.0 simulators? Any Ideas what the issue is?
also - same problem exists for both Xcode 15.4 and Xcode 16.

@stuartmorgan-g
Copy link
Contributor

What I don't understand is why image_picker does work in iOS 17.6 simulators but not iOS 18.0 simulators? Any Ideas what the issue is?

Questions about why any given iOS simulator does or does not work correctly under Rosetta would need to be raised with Apple; we don't have any control over how simulators behave.

@alfietapping

This comment was marked as off-topic.

@burakcbdn

This comment was marked as off-topic.

@duoshankui

This comment was marked as off-topic.

@bahadirarslan
Copy link
bahadirarslan commented Oct 9, 2024

I think this issue is related to this issue #155535
It looks like iOS 18 simulator have some problems. I am facing the same issue now. I am going to remove arm64 from Excluded Architectures and try again.

Update:
Removing arm64 caused another problems.

Launching lib/main.dart on iPhone 16 Pro in debug mode...
Watch companion app found.
Xcode build done.                                           72.9s
Failed to build iOS app
Error (Xcode): Building for 'iOS-simulator', but linking in object file (/Users/bahadirarslan/Development/Flutter/myproject/ios/Pods/MLImage/Frameworks/MLImage.framework/MLImage[arm64][2](GMLImage.o)) built for 'iOS'

Error (Xcode): Linker command failed with exit code 1 (use -v to see invocation)

Could not build the application for the simulator.
Error launching application on iPhone 16 Pro.

I think it is the same for you @Fairfieldfred

@burakcbdn
Copy link

The issue seems to happen when arm64 is excluded for simulator.

Just delete arm64 from Runner -> build settings -> Excluded Architectures

This is the fix.

@babang1da

This comment was marked as off-topic.

@jacksonw765

This comment was marked as off-topic.

@utkudenis
Copy link

I'm dealing with same problem.
flutter version 3.24.3
image_picker 1.1.2 [Latest]
Xcode 16 ios simulator 18 iphone 16 pro max

There is any error or exception on the try catch block
the package directly freezes and app does not response

@ansarikhurshid786

This comment was marked as off-topic.

@ling350181

This comment was marked as off-topic.

@abbasjoyia99

This comment was marked as off-topic.

@YesThatGy
Copy link
YesThatGy commented Nov 5, 2024

I was running into an issue with image_picker and getting symptoms much like this. The app would "freeze" when the below was called and the only way I could get any further progress was to terminate the app and try again. I never was able to get it to successfully pick a file.

  final XFile? galleryFile = await ImagePicker().pickImage(

This is on an M1 MB Air with all updates applied, Android Studio Koala, XCode just installed (latest version) with a target of an iPad running iPadOS 17.x. (whatever is current as of today)

I was building a very simple example app to demonstrate it and noticed that iPadOS 18 was available, and once I applied that the crash disappeared.

In the hopes of being helpful in finding the cause of the bug, I do have some crash output from XCode:

libsystem_kernel.dylib`__abort_with_payload:

    0x1d24b405c <+0>:  mov    x16, #0x209               ; =521 

    0x1d24b4060 <+4>:  svc    #0x80

->  0x1d24b4064 <+8>:  b.lo   0x1d24b4084               ; <+40>

    0x1d24b4068 <+12>: pacibsp 

    0x1d24b406c <+16>: stp    x29, x30, [sp, #-0x10]!

    0x1d24b4070 <+20>: mov    x29, sp

    0x1d24b4074 <+24>: bl     0x1d24a73a4               ; cerror_nocancel

    0x1d24b4078 <+28>: mov    sp, x29

    0x1d24b407c <+32>: ldp    x29, x30, [sp], #0x10

    0x1d24b4080 <+36>: retab  

    0x1d24b4084 <+40>: ret    

@jmagman
Copy link
Member
jmagman commented Nov 5, 2024

I'm going to close this as another bug in the iOS Rosetta simulator. This is a bug in the iOS simulator, not Flutter. Flutter will fall back to the x64 simulator if one or more of your plugins don't support arm. You can try to find the offending plugin by following the steps at #79641 (comment).

If you are seeing this issue on a real device or you are 100% sure all of your plugins support arm64, please file a new issue with specific instructions about how to reproduce. Thank you!

@tungdevpro

This comment was marked as duplicate.

@AhmetAydemir1

This comment was marked as duplicate.

@bahadirarslan

This comment was marked as off-topic.

@danagbemava-nc danagbemava-nc added the r: invalid Issue is closed as not valid label Nov 11, 2024
@flutter flutter locked as resolved and limited conversation to collaborators Nov 13, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
e: OS-version specific Affects only some versions of the relevant operating system fyi-ecosystem For the attention of Ecosystem team p: image_picker The Image Picker plugin. package flutter/packages repository. See also p: labels. platform-ios iOS applications specifically r: invalid Issue is closed as not valid team-ios Owned by iOS platform team waiting for customer response The Flutter team cannot make further progress on this issue until the original reporter responds
Development

No branches or pull requests

0