Open Tom3652 opened 2 weeks ago
Thanks for the report @Tom3652 Is this specific to iOS or Android ? Also, please check below issues and see if they help in your case or not.
https://github.com/flutter/flutter/issues/34230 https://github.com/flutter/flutter/issues/73651
Since you showed me older issues, i have tested them and i have also tested everything using the latest flutter version 3.19.6
.
The below tests are made using my sample code in the issue.
portraitDown
with the error : Failed to change device orientation: Error Domain=UISceneErrorDomain Code=101 "None of the requested orientations are supported by the view controller. Requested: portraitUpsideDown; Supported: landscapeRight" UserInfo={NSLocalizedDescription=None of the requested orientations are supported by the view controller. Requested: portraitUpsideDown; Supported: landscapeRight}
Note : Rotations are blocked if you uncheck the rotation directly in Xcode (in that case, SystemChrome
can't do anything)
portraitUp
&& landscapeRight
or portraitUp
&& landscapeLeft
, only portraitUp
is workingportraitUp
&& landscapeRight
&& landscapeLeft
it works finelandscapeRight
|| landscapeLeft
alone, it starts in the correct orientations but doesn't rotate to the other This follows my initial issue comment.
For now it's all the tests i have made, i have not tried portraitDown
on Android but will update the comment once i do it of course
FYI team-ios: I'm already working on an issue that relates to orientation changes for Android - https://github.com/flutter/flutter/issues/144307. So, I can investigate this area of code as it relates to Android. However, there seems to be a cross-platform issue with SystemChrome.setPreferredOrientations
. As noted above, there have also been a couple other issues reported in the past for iOS. In response to https://github.com/flutter/flutter/issues/147460#issuecomment-2083191592, we may want to clarify the expected iOS behavior in regards to Xcode.
The solution to this issue will warrant additional discussion (see https://github.com/flutter/flutter/issues/148136).
So, I am unassigning myself for now.
Steps to reproduce
PreferredOrientations
Expected results
The device should rotate according to the
PreferredOrientations
selected in the List.Actual results
or :
The device doesn't rotate at all from
portraitUp
The device rotates in all 3 orientations perfectly.
Code sample
Code sample
```dart FutureScreenshots or Video
Screenshots / Video demonstration
[Upload media here]Logs
Logs
```console [Paste your logs here] ```Flutter Doctor output
Doctor output
```console [✓] Flutter (Channel stable, 3.19.6, on macOS 14.4.1 23E224 darwin-x64, locale fr-FR) • Flutter version 3.19.6 on channel stable at /Users/foxtom/Desktop/flutter • Upstream repository https://github.com/flutter/flutter.git • Framework revision 54e66469a9 (10 days ago), 2024-04-17 13:08:03 -0700 • Engine revision c4cd48e186 • Dart version 3.3.4 • DevTools version 2.31.1 [✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0) • Android SDK at /Users/foxtom/Library/Android/sdk • Platform android-34, build-tools 34.0.0 • Java binary at: /Applications/Android Studio.app/Contents/jbr/Contents/Home/bin/java • Java version OpenJDK Runtime Environment (build 17.0.9+0-17.0.9b1087.7-11185874) • All Android licenses accepted. [✓] Xcode - develop for iOS and macOS (Xcode 15.3) • Xcode at /Applications/Xcode.app/Contents/Developer • Build 15E204a • CocoaPods version 1.15.2 [✓] Chrome - develop for the web • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome [✓] Android Studio (version 2023.2) • Android Studio at /Applications/Android Studio.app/Contents • Flutter plugin can be installed from: 🔨 https://plugins.jetbrains.com/plugin/9212-flutter • Dart plugin can be installed from: 🔨 https://plugins.jetbrains.com/plugin/6351-dart • Java version OpenJDK Runtime Environment (build 17.0.9+0-17.0.9b1087.7-11185874) [✓] VS Code (version 1.88.1) • VS Code at /Users/foxtom/Desktop/Visual Studio Code.app/Contents • Flutter extension version 3.46.0 [✓] Connected device (5 available) • moto g 8 power (mobile) • ZY22BNDW2C • android-arm64 • Android 11 (API 30) • iPhone de Nathalie (mobile) • 00008030-000E64110A8A802E • ios • iOS 17.4.1 21E236 • Now You See Me (mobile) • 00008020-001204401E78002E • ios • iOS 17.4.1 21E236 • macOS (desktop) • macos • darwin-x64 • macOS 14.4.1 23E224 darwin-x64 • Chrome (web) • chrome • web-javascript • Google Chrome 124.0.6367.92 ! Error: Browsing on the local area network for Apple Watch de Tom. Ensure the device is unlocked and discoverable via Bluetooth. (code -27) [✓] Network resources • All expected network resources are available. • No issues found! ```