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
Xcode 12 / iOS 14 / image pick (single and multiple) / from image_picker #65995 #407
Comments
I wasn't able to get this issue, but there was actually one issue with the picker for iOS 14 that I've already addressed. Would you mind to please check 2.0.1+2? Thank you! |
I tried again with |
@monsieurtanuki theres yet too little information about this online. I can't seem to find a reliable example, I'll have to dig it a bit more. |
Is there a way I or you can put extra print statements in your code in order to understand what's wrong? |
@monsieurtanuki building with Xcode should be enough. You can put it from there (navigate through Pods until file_picker). |
@miguelpruivo I don't know anything about Xcode / swift. - (void) resolvePickMedia:(MediaType)type withMultiPick:(BOOL)multiPick withCompressionAllowed:(BOOL)allowCompression {
Print("Hi there!"); // something like that <<<
if (@available(iOS 14, *)) {
PHPickerConfiguration *config = [[PHPickerConfiguration alloc] init];
config.filter = type == IMAGE ? [PHPickerFilter imagesFilter] : type == VIDEO ? [PHPickerFilter videosFilter] : [PHPickerFilter anyFilterMatchingSubfilters:@[[PHPickerFilter videosFilter], [PHPickerFilter imagesFilter]]];
|
@monsieurtanuki it's not the easiest thing to do, you'll need to go through Pods (see screenshot) and add debug code there. Since it's made with Objective-C you can't use If you want to print out variables you can do |
@miguelpruivo I know that what I do has an impact on the actual executed code - I managed to add crashes here and there in Objective-C, but I cannot see where the |
@miguelpruivo I could find a right window, that stayed desperately blank (but black). |
@monsieurtanuki rolling back will prevent you from building to iOS 14. As I’m the only maintainer I have to take a further look into this on my off hours. I’m sorry for any inconvenience, I’ll do my best as soon as I can to fix this. |
@miguelpruivo Oh, nothing personal. It's just that initially I developed apps on Android, then I wanted to develop apps on iOS too, and I literally spent (wasted?) months about that. And I was about to deliver a production version of my app this week. Thanks for your library anyway, and I hope that very soon the issue will be fixed! And I know how frustrating it can be when someone reports a bug that you cannot reproduce ;) |
This is an urgent issue, so I’ll try to fix it ASAP. Don’t worry. :) |
Any updates on the invalid path for picking an image? I'm using FileType.media to display an image widget and getting this error (which seems slightly different from issue #406 's error):
Don't know what the version, uuid, and mode parameters mean/are there for but maybe it can help find the issue? |
@tneotia this is still WIP, I’ll keep you updated. |
Please, check #405 answer and let me know if it's working now. |
@miguelpruivo The interface is slightly different, but I still cannot see any file: And I can see pictures with the "Photos" app: Could it be that with the new system you cannot see the pics on your iPhone, but only the ones in iCloud? (I don't use iCloud) |
@monsieurtanuki it seems that right now it isn't loading the photos picker... Is your filetype set to FileType.media? That's what I use to open just the image picker rather than files picker. |
@monsieurtanuki what is the |
That's strange... I haven't tested with the new branch but previously the picker was showing for me, just my app was unable to open the image from the path with the error I commented above. @miguelpruivo I will update you with my findings in 30min-1hr - I don't have a physical device so I can only test on simulator. |
@monsieurtanuki using Using |
@miguelpruivo Just curious: is that typical apple non-sense, that
@tneotia said "it seems that right now it isn't loading the photos picker", which would match what I experience. |
@monsieurtanuki Apple does not have a typical file explorer like Android. I mean, it actually does, it's the Files app that ships with iOS. However, it mostly relies on iCloud documents (or any other provider such GDrive, Dropbox etc.) and/or local documents if you already have saved there. You can't navigate thought directories and such, like on Android. So yes, you can assume that it being empty on the simulator is the most normal thing to see. When I try with the plugin's example app and my own iPhone (iOS 14) it works properly (and I have more than 10k media on my iPhone). Could it be something else? Does that happen with the example app? |
@miguelpruivo This makes much more sense now. I'll try this and will surely let you know. |
@miguelpruivo This worked perfectly for me. |
@BirjuVachhani good to know. I'll probably publish a new version with it later today. |
@miguelpruivo That sounds great. I have a production release tomorrow so I am really looking forward to it. |
Works like a charm! (I tried it using FileType.image) |
Works 💯 % |
Deployed with 2.0.6. You can now update your dependency to @monsieurtanuki having your issue is still preventing me from closing this as it seems a bit different, however, couldn't find any possible way to replicate it. 😞 If you manage to create a simple project with all the steps, that'd be great! |
@miguelpruivo great work! Thanks a lot. I'll try it out asap... |
@miguelpruivo I've created the simplest project: https://github.com/monsieurtanuki/picker_unavailable |
@monsieurtanuki thank you, all try that as soon as possible. |
@miguelpruivo I tested it and it works like a charm! ❤️ |
Thanks @miguelpruivo for your time and effort. Using version Side note about a possible bug in the iOS simulator: |
@osaxma nice finding! Indeed I have noticed that HDR pictures from simulator can’t be loaded, but on physical device it worked just fine, so I ignored it, since I can assume it must be a simulator issue. But after your finding, it turns out it’s probably an iOS 14 issue when loading HDR assets (which is required when you edit in your photos app). |
@monsieurtanuki with your sample, it showed briefly (1 second I'd say) the Picker unavailable message but then it loaded the content immediately. It seems that there is some issue regarding PHPicker on iOS itself and it was also reported recently here. I believe that if you remove the Xcode derived data and run a full clean, it should work properly (or in a different simulator). |
@miguelpruivo I tried again and again, by cleaning, with a different Simulator, but I still get the "Picker Unavailable" message - and nothing more even one minute after. Two remarks:
pod deintegrate && rm Podfile.lock && pod install
|
@monsieurtanuki that warning is "normal" and it's always there unless a custom configuration is provided (from your app) but that isn't required. Using iOS 13 style on iOS 14 could result in unexpected crashes (hence the image_picker issue — from iOS 14 and later, devs should use PHPicker which is more reliable and offers more options such as a search bar). However, you shouldn't and you can't get that issue. I'm surprised that you do. There must be something in your setup that's resulting in that but I didn't figure what yet because you seem to be the only one with that. Do you have a real device where you can test? |
@miguelpruivo OK for your comments about the warning message and the irrelevancy of iOS 13 settings on iOS 14. I don't have an actual iPhone to test it on, though I know it's part of the sick Apple business model to force developers to buy a Mac and an iPhone. I managed to get a Mac from a friend, I managed to use a friend's iPad for the once-in-a-lifetime account set-up in Xcode, but that's it for me. Obviously you cannot do anything about iOS 14 bugs. Thanks for your help anyway, and feel free to close this issue. |
@monsieurtanuki I'm sorry that I couldn't help you much further than this. 😞 Let me know if you come up with a solution as I'm interested to know what could be potentially causing it. If anyone experience the same issue reported by OP, please feel free to reopen this. Thank you! |
@miguelpruivo I hate to reopen this but I pushed a build to TestFlight today and my tester had a crash when opening from gallery. It's super long, but here it is: Incident Identifier: 76A98804-AF61-4159-9CDF-DD1EC5C53459 Date/Time: 2020-10-04 02:43:50.1257 +0300 Exception Type: EXC_BAD_ACCESS (SIGSEGV) Termination Signal: Segmentation fault: 11 Thread 0 name: Thread 1 name: Thread 2 name: Thread 3 name: Thread 4 name: Thread 5 name: Thread 6 name: Thread 7 name: Thread 8 name: Thread 9 name: Thread 10 name: Thread 11 name: Thread 12 name: Thread 13 name: Thread 14 name: Thread 15: Thread 16 name: Thread 17: Thread 18: Thread 19 name: Thread 20: Thread 21 name: Thread 16 crashed with ARM Thread State (64-bit): Binary Images: EOF I looked this up and some people point to it being some sort of memory leak, but I can't find anything related to this and PHPicker. Or is this a problem in my app rather than the plugin? |
Hi @tneotia, I don’t actually see anything there related to the plugin itself. Might be something else with the app or any other plugin. 😞 |
Alright, thanks! I'll try to look into it but I don't have much experience reading swift logs |
@miguelpruivo I looked into it a little today and here's how to reproduce it:
I don't know if this will be reproducible on the example app or if there is something specific in the way I am using the image that is causing the app to crash, but could you see if you are able to reproduce this using the method above? Or anyone else if they would like as well. Edit: Cloned source and was able to reproduce on example app as well. Same method as above, on dropdown choose media or image and then spam the file picker button. |
I ran with Xcode to debug and it pointed out these lines as where the exception occurred:
with error and
with error In Sorry if this is useless, as I said earlier I don't have any experience with debugging Swift and such. If this seems like an error due to this plugin, I can help debug anything else you would like. If not, I assume it is an iOS issue? Can't understand how this would be specific to my app but maybe it is? |
@tneotia can you try reproduce it with the example app? |
Yep I mentioned above in an edit that it was reproducible on example as well |
@tneotia well, I'll take a look as soon as I have the time, but this seems like low priority for me as it should be just worker threads conflicting due to multiple calls to the picker — I don't actually think an user will try to do so and if he does, shouldn't fear undesired behaviors (this also happens sometimes if you brute force some feature in any app/OS 😄). Nevertheless, I'd be happy to take care of it and make it even better. Thank you! |
Oh I see. No problem, for me its not really a blocker since the user isn't going to be spamming the images, just something I found while testing a build. Take your time with this, and if you need anything else let me know! |
Describe the bug
cf. flutter/flutter#65995
I created a brand new project from scratch and I still get the following message:
Issue details
FilePicker.platform.pickFiles(type: FileType.image)
andFilePicker.platform.pickFiles(type: FileType.image, allowMultiple: true)
Screenshots and/or video
Screenshot
Flutter Version details
flutter doctor -v
The text was updated successfully, but these errors were encountered: