FilePicker on MacCatalyst app is not working (occasionally)

See original GitHub issue

Description

FilePicker returns null as soon as it pops up, 8 out of 10 times. var result = await FilePicker.Default.PickAsync();

Steps to Reproduce

  1. Create a new .Net MAUI App on Mac in Visual Studio.
  2. In the MainPage.xaml.cs add the following (to the sample button handler OnCounterClicked:
var result = await FilePicker.Default.PickAsync();
if (result != null)
{
    int u = 0;  
}
  1. Put a breakpoint on the “if” statement and run the app.
  2. Click on the button on the sample app.

This should let you choose a file and the name should return in the result above. But instead it sometime just returns with the result null as soon as the dialog pops up.

If you don’t see the bug, try to restart the app, or rebuild it.

Link to public reproduction project repository

Version with bug

7.0 (current)

Last version that worked well

Unknown/Other

Affected platforms

macOS

Affected platform versions

macOS Ventura 13.3.1 x64

Did you find any workaround?

No response

Relevant log output

No response

Issue Analytics

  • State:open
  • Created 4 months ago
  • Reactions:1
  • Comments:6

github_iconTop GitHub Comments

1reaction
petervaradicommented, May 17, 2023

There is a duplicate bug I just found: https://github.com/dotnet/maui/issues/11088

0reactions
brightertoolscommented, Jul 31, 2023

I ended up using this as a workaround: https://github.com/datvm/LukeMauiFilePicker

Thanks for the link, however I tried this but gives me the filename not the full path to the file and its no longer supported as per the issue that also mentions this problem. Did you have this issue?

UPDATE:

I forked that repro and fixed it [tested via TestFlight], forked version here:

https://github.com/brightertools/MauiFilePicker

Read more comments on GitHub >

github_iconTop Results From Across the Web

File picker (Open and Save Panel) not working
Hello All, since last few weeks , all of sudden i am finding the File picker in Open and save panel getting stuck....
Read more >
Mac Catalyst app won't launch in Xcode
I'm building an app for deployment on iPhone, iPad and Mac Catalyst. I am using Automatic Code Signing. Project build without a single ......
Read more >
2022 - Dave's Tech Blog
NET MAUI on Android, iOS, Mac Catalyst, and Windows. The main problem with my implementation was that the FilePicker for picking local audio...
Read more >
.NET Maui FilePicker results in This platform does not ...
I am building a desktop app in .NET Maui which targets Windows and MacOS. When using the built-in FilePicker on Mac (Catalyst) I...
Read more >
Mono interpreter on iOS and Mac Catalyst - .NET MAUI
Learn how to enable the Mono interpreter, which lets you use dynamic code generation in your .NET MAUI iOS and ARM64-based Mac Catalyst...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found