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

Documentation for building iOS apps is plain wrong

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • P2: Important
    • 6.2.11, 6.5.4, 6.6.0
    • 6.4.2
    • None
    • MacOS Monterey (12.6), Qt Creator 9.0.1, Qt 6.4.2, XCode 14.2, CMake 3.24.2, Apple clang version 14.0.0 (clang-1400.0.29.202)
    • iOS/tvOS/watchOS
    • e9a7a35e3 (dev), d54ab2533 (6.6), e5dd889fd (6.5), 4f83c562d (6.6.0), 00c938441 (dev), 31927170c (6.6), 9a4d8cbb0 (6.5), c145334f9 (tqtc/lts-6.2), 1e40c3e54 (tqtc/lts-6.2), 54a275a26 (dev), a3c6a3e75 (6.6), aefe38250 (6.5), 87a50a4c2 (tqtc/lts-6.2)

    Description

      Apologies for the confrontational headline but this has been a hellish and protracted process but I've finally found a reliable way to put together an App Store-ready iOS project after days of frustrating experimentation.

      Your documentation is correct in as far as it lets you get a project into Xcode and run it, complete with app icon, on an iOS device. However I simply don't believe that anyone at Qt actually went the extra steps to generate an archive *and get it validated*, at least not following the documentation.

      I wish to request the following changes to your iOS platform notes. I've taken the time to explain the why and how and I've included steps to replicate the processes too.

       

      *Product archiving issue with CMake*

      You have usefully provided this section at the bottom of the page, though I want to request the final paragraph be changed to:

      To work around the issue, make sure to manually build a Release version of the project before trying to create an archive.

      This is because by default, generating a build for run will generate a Debug version which does not generate the Release-iphoneos folders that are needed.

       

      *App icons*

      There are 3 major problems with the documentation here.

      1. Xcode now requires that the app icon be provided within an asset catalog. So your Icons section (https://doc.qt.io/qt-6/ios-platform-notes.html#application-assets) is misleading. I have provided the correct Info.plist data below. Note that this means users will need to create an Info.plist.in file and specify use of this in the set_target_properties(). It's worth spelling this out with a code example to save developers wasted time.
      2. When you add an asset catalog using CMake it is not enough to include the path to the catalog. You also need to replicate the internal folder structure otherwise Xcode will not pick it up correctly.
      3. In Xcode 14, there is an essential manual step of setting the App Icon in the Project > Target > General tab. Unless the Info.plist specifies the asset catalog and this App Icon field specifies the name of the app icon set, the icon will not be correctly set and the archive will not validate. Please make this explicit in your documentation.

      Please see my solution on the CMake Discourse: https://discourse.cmake.org/t/how-to-incorporate-app-icon-files-for-ios-into-xcode-14/7386/2

      This contains a step by step approach, along with code snippets. I believe it's worth also including the following CMake snippet in your documentation:

      set_target_properties(MyApp PROPERTIES
          MACOSX_BUNDLE TRUE
          MACOSX_BUNDLE_GUI_IDENTIFIER org.myorg.myapp
          MACOSX_BUNDLE_BUNDLE_VERSION ${PROJECT_VERSION}
          MACOSX_BUNDLE_SHORT_VERSION_STRING ${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}
          MACOSX_BUNDLE_INFO_PLIST "${CMAKE_CURRENT_SOURCE_DIR}/Info.plist.in"
          QT_IOS_LAUNCH_SCREEN "${CMAKE_CURRENT_SOURCE_DIR}/LaunchScreen.storyboard"
      ) 

       

      (If you scroll to the top of my CMake Discourse post you'll see the problems I encountered. Example 1 uses separate icons as your documentation suggests. Example 2 uses an asset catalog but without replicating the full folder structure.)

      Attachments

        Issue Links

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

          Activity

            People

              alexandru.croitor Alexandru Croitor
              paulmasri Paul
              Votes:
              2 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes