-
-
Notifications
You must be signed in to change notification settings - Fork 132
fix: ios crash camera permissions #426
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
Conversation
|
👋 Hello @asabri97, thank you for submitting a
For more guidance, please refer to our Contributing Guide. Don't hesitate to leave a comment if you have any questions. Thank you for contributing to Ultralytics! 🚀 |
…/ultralytics/yolo-flutter-app into fix-ios-crash-camera-permissions
UltralyticsAssistant
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🔍 PR Review
Made with ❤️ by Ultralytics Actions
Solid crash-hardening overall: iOS permission/device nil handling looks correct and Android’s isStopped gating meaningfully reduces dispose/onFrame races. Main issue: the new restartCamera hook bypasses the existing permission/lifecycle guards by calling startCamera() directly; routing it through initCamera() (and/or adding precondition guards inside startCamera()) would make the fix robust. Example app rebuild trigger is likely effective but may introduce an extra initial rebuild.
💬 Posted 3 inline comments
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
|
Merged—huge thanks @asabri97 (and @onuralpszr for the contributions) for landing this stability-focused upgrade in the Flutter app.
This PR is a great example of that mindset: proactively hardening camera flows across iOS and Android, removing crash paths (permission-denied, missing inputs, teardown races), and adding a practical Appreciate the care, testing, and polish here—this will save developers (and users) a lot of frustration. |
🛠️ PR Summary
Made with ❤️ by Ultralytics Actions
🌟 Summary
Fixes critical camera-related crashes on iOS and Android and improves camera restart behavior across app navigation 🔧📷✅
📊 Key Changes
AVCaptureDevice.authorizationStatus).fatalErrorand replacedtry!with safedo-catch+ early returns to avoid hard crashes when no camera/input is available.@Volatile isStoppedflag and checked it at multiple points inonFrameto avoid using closed resources afterstop().close()handling.restartCameraand a Dart APIYOLOViewController.restartCamera().CHANGELOG.md.🎯 Purpose & Impact
restartCamera()hook for manual recovery flows when needed.