Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-133577

[iOS] [REG] Including a Swift file leads to a startup error

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • P1: Critical
    • 6.8.3, 6.9.0 Beta3, 6.10.0 FF
    • 6.7.3, 6.8.2
    • QPA
    • None
    • iOS/tvOS/watchOS
    • 430ba7c0f (dev), 9fbb8e009 (6.9), 835c54bc1 (6.8)

    Description

      1. Create a Qt Quick app and build it.
      2. Open the project in Xcode.
      3. Add a swift file to the project.
        File.swift
        import Foundation
        
      1. Build it and deploy it on a device.
      2. The app crashes at startup:
        Error: You are creating QApplication before calling UIApplicationMain. If you are writing a native iOS application, and only want to use Qt for parts of the application, a good place to create QApplication is from within 'applicationDidFinishLaunching' inside your UIApplication delegate.
        

       

      Adding a Swift file to the project is needed so that I can include in my apps the Firebase library and other 3rd party ad libraries (e.g. Meta). This used to work in Qt5 and in some previous versions of Qt6. The last time it worked was with Qt 6.7.2.

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            vestbo Tor Arne Vestbø
            adrian.gabureanu Adrian Gabureanu
            Votes:
            1 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes