Details
Description
While integrating Apple CarPlay with a Qt-based iOS app, the main application launches and works correctly. However, when the CarPlay scene is triggered (via CPTemplateApplicationSceneSessionRoleApplication), the CarPlay display shows a blank screen.
The issue appears to be related to the following assertion in the Qt iOS platform plugin:
ASSERT: "[scene isKindOfClass:UIWindowScene.class]" in file /Users/qt/work/qt/qtbase/src/plugins/platforms/ios/qiosapplicationdelegate.mm, line 43 Can't show file for stack frame : <DBGLLDBStackFrame: 0x7fa35def2fd0> - stackNumber:3 - name:qAbort. The file path does not exist on the file system: /Users/qt/work/qt/qtbase/src/corelib/global/qassert.cppMessage from debugger: killed
Though this assertion doesn't crash the app, it likely causes the CarPlay scene to be ignored or mishandled, resulting in an unresponsive blank UI on the CarPlay display.
In iOS, CarPlay uses a different scene class (CPTemplateApplicationScene) which is not a subclass of UIWindowScene. The hardcoded assertion incorrectly assumes all scenes will be UIWindowScene, which is invalid in multi-scene apps that support CarPlay.
Expected Result:
The Qt iOS platform plugin should support scene types like CPTemplateApplicationScene, or at the very least skip processing them without affecting the CarPlay UI.
Actual Result:
- The CarPlay display shows a blank screen.
- No crash occurs, but the assertion "[scene isKindOfClass:UIWindowScene.class]" is triggered, indicating a mismatch in scene handling logic.
Environment:
- Qt Version for iOS: [Qt 6.9.0]
- Qt Creator: [Qt 16.0.0]
- iOS Version: [iOS 18.3.1]
- Xcode Version: [Xcode 16.3]
- Device: iPhone with CarPlay (simulator from Xcode additional tools)
Info.plist:
<key>UISupportsCarPlay</key> <true/> <key>UIApplicationSceneManifest</key> <dict> <key>UIApplicationSupportsMultipleScenes</key> <true/> <key>UISceneConfigurations</key> <dict> <key>CPTemplateApplicationSceneSessionRoleApplication</key> <array> <dict> <key>UISceneClassName</key> <string>CPTemplateApplicationScene</string> <key>UISceneConfigurationName</key> <string>CarPlayScene Configuration</string> <key>UISceneDelegateClassName</key> <string>CarPlaySceneDelegate</string> </dict> </array> </dict> </dict>
I wonder if Qt Creator actually supports integrating with CarPlay.
Please Note:
I use Qt with CMake. I have added this to User Story as I am not sure if I should add it as a bug.