Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. Xcode build fails for ios 17.6

Xcode build fails for ios 17.6

Scheduled Pinned Locked Moved Solved Mobile and Embedded
5 Posts 2 Posters 419 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • K Offline
    K Offline
    Kiovtorov
    wrote on 25 Nov 2024, 21:45 last edited by Kiovtorov
    #1

    I have connected my ios 17.6 to my laptop and tried to build my qt app thinking it would work as well as with the simulator but the xcode build fails.
    The documentation says

    For iOS devices with iOS 16 or earlier, Qt Creator also supports accessing the application output, debugging, and profiling. However, these features are not supported for physical devices with iOS 17 or later because of limitations of the Apple tool for accessing these devices.
    You can build applications for the latest iOS version and deploy them to previous versions. For the most part, this works automatically. However, you must take care when you manually set your own target version. If you set it to a value higher than what Qt requires and supply your own Info.plist file, you must add an LSMinimumSystemVersion entry to the Info.plist that matches the value of CMAKE_OSX_DEPLOYMENT_TARGET (when using CMake), QMAKE_IOS_DEPLOYMENT_TARGET (when using qmake), or cpp.minimumIosVersion (when using Qbs) because iOS (and the App Store) will use the LSMinimumSystemVersion value as the authoritative one.
    

    I tried to do that in my cmake file but failed

    cmake_minimum_required(VERSION 3.16)
    
    project(Finbank VERSION 0.1 LANGUAGES CXX)
    
    set(CMAKE_CXX_STANDARD_REQUIRED ON)
    
    set(CMAKE_AUTOMOC ON)
            set(CMAKE_AUTORCC ON)
            set(CMAKE_AUTOUIC ON)
            set(CMAKE_OSX_SYSROOT iphoneos) # Use `iphonesimulator` for the simulator
            set(CMAKE_OSX_ARCHITECTURES arm64) # iOS devices typically require arm64 architecture
            set(CMAKE_XCODE_ATTRIBUTE_ENABLE_BITCODE YES)
            set(CMAKE_OSX_DEPLOYMENT_TARGET "14.0") # Adjust the version based on your requirements
    
    find_package(Qt6 6.5 REQUIRED COMPONENTS Quick Multimedia NetworkAuth Sql Charts)
    
    qt_standard_project_setup(REQUIRES 6.5)
    
    
    qt_add_executable(appFinbank
            src/main.cpp
            src/register.hpp src/register.cpp
            src/databasemanager.hpp src/databasemanager.cpp
            src/login.hpp src/login.cpp
            src/googlegateway.hpp src/googlegateway.cpp
            src/dashboard.hpp src/dashboard.cpp
            src/searchrecipent.hpp src/searchrecipent.cpp
            src/createtransaction.hpp src/createtransaction.cpp
            src/stockapiclient.hpp src/stockapiclient.cpp
    )
    qt_add_qml_module(appFinbank
        URI Finbank
        VERSION 1.0
        QML_FILES
                qml/LandingPage.qml
                qml/SignUp.qml
                qml/SignInWindow.ui.qml
                qml/TradingDashboard.qml
                qml/Stock.qml
                qml/TransactionsWindow.ui.qml
                qml/DashboardWindow.ui.qml
                qml/SendMoneyWindow.ui.qml
                qml/SelectRecipent.qml
                qml/RecipentDescription.qml
                qml/SignUpWindow_1.ui.qml
                qml/RecipentDescriptionWindow.ui.qml
                qml/TransferType.qml
                qml/SignIn.qml
                qml/Currencies.qml
                qml/TradingMarket.qml
                qml/SelectRecipentWindow.ui.qml
                qml/TradingMarketWindow.ui.qml
                qml/OverviewTransactionWindow.ui.qml
                qml/CurrenciesWindow.ui.qml
                qml/FoundUser.qml
                qml/Dashboard.qml
                qml/Transactions.qml
                qml/SingleTransactionDetail.qml
                qml/TransactionDetailsWindows.ui.qml
                qml/SendMoney.qml
                qml/SignUpWindow.ui.qml
                qml/LogInWindow.ui.qml
                qml/SelectedRecipent.qml
                qml/TradingDashboardWindow.ui.qml
                qml/OverviewTransaction.qml
                qml/SignUp1.qml
                qml/TransferTypeWindow.ui.qml
            RESOURCES resources/resources.qrc
    )
    
    qt_add_ios_ffmpeg_libraries(appFinbank)
    
    
    # Qt for iOS sets MACOSX_BUNDLE_GUI_IDENTIFIER automatically since Qt 6.1.
    # If you are developing for iOS or macOS you should consider setting an
    # explicit, fixed bundle identifier manually though.
    set_target_properties(appFinbank PROPERTIES
    #    MACOSX_BUNDLE_GUI_IDENTIFIER com.example.appFinbank
        MACOSX_BUNDLE_BUNDLE_VERSION ${PROJECT_VERSION}
        MACOSX_BUNDLE_SHORT_VERSION_STRING ${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}
        MACOSX_BUNDLE TRUE
        WIN32_EXECUTABLE TRUE
    )
    
    target_link_libraries(appFinbank
        PRIVATE Qt6::Quick Qt6::Multimedia Qt6::NetworkAuth Qt6::Sql Qt6::Charts
    )
    
    include(GNUInstallDirs)
    install(TARGETS appFinbank
        BUNDLE DESTINATION .
        LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
        RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
    )
    
    
    1 Reply Last reply
    0
    • H hskoglund
      25 Nov 2024, 22:20

      Try changing the sysroot cmd to (as the comment says)

      ...
      set(CMAKE_OSX_SYSROOT 'iphonesimulator' ) # Use `iphonesimulator` for the simulator
      ...
      
      K Offline
      K Offline
      Kiovtorov
      wrote on 26 Nov 2024, 09:35 last edited by Kiovtorov
      #3

      @hskoglund
      Still no result. Is there any additional library it may need?

      1 Reply Last reply
      0
      • H Offline
        H Offline
        hskoglund
        wrote on 25 Nov 2024, 22:20 last edited by
        #2

        Try changing the sysroot cmd to (as the comment says)

        ...
        set(CMAKE_OSX_SYSROOT 'iphonesimulator' ) # Use `iphonesimulator` for the simulator
        ...
        
        K 1 Reply Last reply 26 Nov 2024, 09:35
        0
        • H hskoglund
          25 Nov 2024, 22:20

          Try changing the sysroot cmd to (as the comment says)

          ...
          set(CMAKE_OSX_SYSROOT 'iphonesimulator' ) # Use `iphonesimulator` for the simulator
          ...
          
          K Offline
          K Offline
          Kiovtorov
          wrote on 26 Nov 2024, 09:35 last edited by Kiovtorov
          #3

          @hskoglund
          Still no result. Is there any additional library it may need?

          1 Reply Last reply
          0
          • K Offline
            K Offline
            Kiovtorov
            wrote on 26 Nov 2024, 09:52 last edited by
            #4

            I got a strange popup when I commented

            set(CMAKE_OSX_ARCHITECTURES arm64) # iOS devices typically require arm64 architecture
                    set(CMAKE_XCODE_ATTRIBUTE_ENABLE_BITCODE YES)
                    set(CMAKE_OSX_DEPLOYMENT_TARGET "14.0")
            

            and I set

                    set(CMAKE_OSX_SYSROOT iphoneos) # Use `iphonesimulator` for the simulator
            
            

            I got popup saying
            codesign wants to access key "Apple Development: Boyan Kyovtorov (Boyan Kyovtorov)" in your keychain
            Where i enter my macbook password 3 times with "Always allow" and it built. But I don't see an app on my Iphone

            1 Reply Last reply
            0
            • K Offline
              K Offline
              Kiovtorov
              wrote on 26 Nov 2024, 10:25 last edited by
              #5

              I needed to add developer mode and trust the developer on my iphone

              1 Reply Last reply
              0
              • K Kiovtorov has marked this topic as solved on 26 Nov 2024, 10:25

              1/5

              25 Nov 2024, 21:45

              • Login

              • Login or register to search.
              1 out of 5
              • First post
                1/5
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • Users
              • Groups
              • Search
              • Get Qt Extensions
              • Unsolved