-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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.4, Barometer.Default.Start hangs indefinately #20930
Comments
Are you testing this on an actual device or the Simulator? I can imagine this is one thing that is not implemented in the Simulator. Also you indicate that this has worked in previous .NET MAUI versions? Can you confirm that? Do you know which version exactly? |
Hi @sbloom82. We have added the "s/needs-info" label to this issue, which indicates that we have an open question for you before we can take further action. This issue will be closed automatically in 7 days if we do not hear back from you by then - please feel free to re-open it if you come back to this issue after that time. |
Hi @sbloom82. We have added the "s/needs-repro" label to this issue, which indicates that we require steps and sample code to reproduce the issue before we can take further action. Please try to create a minimal sample project/solution or code samples which reproduce the issue, ideally as a GitHub repo that we can clone. See more details about creating repros here: https://github.com/dotnet/maui/blob/main/.github/repro.md This issue will be closed automatically in 7 days if we do not hear back from you by then - please feel free to re-open it if you come back to this issue after that time. |
I have same problem but on native framework, it cause by the iOS so you must report to Apple. |
No, this is not a simulator issue. I see the |
Seems like the interface of https://developer.apple.com/documentation/coremotion/cmaltitudehandler?changes=latest_minor |
We encountered this issue in our production app on real devices for users who updated to iOS 17.4 beta. Our app initializes the barometer on startup, so this caused the app to hang on startup and never fully load. This has worked since we implemented it in our maui 8 app. Users who are not on iOS 17.4 have an app that is working as expected. We had to issue an update to skip barometer initialization for 17.4 ios devices. |
Seems like this might have to do with #21057 then maybe? |
Hm, why does it hang? I see a hard crash, unfortunately :/ In my case, |
Yes, it's certainly related to API changes in XCode 15.3 / iOS 17.4. |
I'm not aware of any previous MAUI version that works, but it seems that the Certainly the Xamarin code suffers from the API change as well. I assume the difference is that the exception is catchable there. I don't understand why it is not in MAUI, but for me this is actually the biggest issue (if the exception was catchble, the API change would be half as bad). |
Now that apple has released ios 17.5 (and the 17.4 minor versions), when "Motion & Fitness" permission is not granted, the app will crash after starting the barometer. Here's all of my work arounds private async Task InitBarometer()
{
try
{
#if IOS
var version = DeviceInfo.Current.Version;
if (version.Major == 17 && version.Minor == 4)
{
_barometerDisabledReason = "Barometer is disabled for iOS 17.4. Update to iOS 17.5 to enable.";
throw new Exception(_barometerDisabledReason);
}
var status = await Permissions.CheckStatusAsync<Permissions.Sensors>();
if (status != PermissionStatus.Granted)
{
_barometerDisabledReason = "Barometer is disabled. Please grant permission to 'Motion & Fitness' to enable.";
throw new Exception(_barometerDisabledReason);
}
#endif
_isBarometerEnabled = Barometer.Default.IsSupported;
if (_isBarometerEnabled)
{
Barometer.Default.ReadingChanged += Barometer_ReadingChanged;
Barometer.Default.Start(SensorSpeed.Default);
}
}
catch
{
_isBarometerEnabled = false;
}
await Task.CompletedTask;
} |
I still see this with Maui 8.0.100, .NET SDK 8.0.404, iOS workload 18.0.8314 and XCode 16.1 (on an iPad with iOS 18.1.1). I get a hard crash upon calling
|
Description
I have an app that uses the barometer and initializes it upon app startup. On iOS 17.4, calling Barometer.Start() results a hang. Using the debugger, we can see the exception thrown in the output window. The exception is not bubbled out to the caller, so it cannot be handled.
Steps to Reproduce
Using this code, running on iOS 17.4, the call to Start() hangs indefinitely
var _isBarometerEnabled = Barometer.Default.IsSupported;
if (_isBarometerEnabled)
{
Barometer.Default.ReadingChanged += Barometer_ReadingChanged;
Barometer.Default.Start(SensorSpeed.Default);
}
Link to public reproduction project repository
No response
Version with bug
8.0.6 SR1
Is this a regression from previous behavior?
Yes, this used to work in .NET MAUI
Last version that worked well
8.0.6 SR1
Affected platforms
iOS
Affected platform versions
iOS 17.4
Did you find any workaround?
No workaround, other than not using the Barometer
Relevant log output
The text was updated successfully, but these errors were encountered: