4

My Qt and Qt Creator knowledge is horribly lacking and I'm stuck trying to rebuild our existing application to make it 64-bit for iOS 11.

When building a release version for iOS, I get the following error:

Check dependencies
Code Signing Error: No profiles for 'com.yourcompany.MYTESTAPP' were found:  Xcode couldn't find any iOS App Development provisioning profiles matching 'com.yourcompany.MYTESTAPP'. Automatic signing is disabled and unable to generate a profile. To enable automatic signing, pass -allowProvisioningUpdates to xcodebuild.
Code Signing Error: Code signing is required for product type 'Application' in SDK 'iOS 11.0'

I tried to replace com.yourcompany in Info.plist but it appears that file is generated automatically on every build, so changes there are overridden. Is there another way to replace that domain with our domain?

The easiest solution would probably be to do what the error suggests and pass -allowProvisioningUpdates to xcodebuild, but I can't figure out how... Plus I can't find any helpful articles on the subject.

I did find this SO question but the answers there are way too advanced for a beginner like myself. I tried the following based on the accepted answer, without any effect:

contains(MYDEFINES, iOS) {
    QMAKE_CXXFLAGS += -allowProvisioningUpdates
}

EDIT: it's probably important to know that I did enable "Automatically manage signing" Qt Creator's Build Settings. And that I'm on Qt 5.9.1 and Qt Creator 4.4.0.

Vadim Kotov
  • 8,084
  • 8
  • 48
  • 62
delucasvb
  • 5,393
  • 4
  • 25
  • 35
  • When executing the command manually from a terminal, `xcodebuild build -project MYTESTAPP.xcodeproj -scheme MYTESTAPP -configuration Release -destination generic/platform=iOS -destination-timeout 1 -allowProvisioningUpdates`, it does go a lot further but then crashes saying `The following build commands failed: Ld PORTA.build/Release-iphoneos/PORTA.build/Objects-normal/arm64/PORTA normal arm64`. I'll guess I'll look into that – delucasvb Sep 26 '17 at 11:35

2 Answers2

2

I'd had the same issue when building using CI. Searching trough the Makefile and its includes I found that you can pass extra flags to xcodebuild using the XCODEBUILD_FLAGS variable. Adding that your build environment should do the trick.

Reinder
  • 305
  • 1
  • 9
  • That is where you add the flag (in Qt under Project, in the list of settings labeled "build environment"), but unfortunately that still doesn't work. It does change the error, though, to this: "xcodebuild[62700:9920056] DVTPortal: Service '' encountered an unexpected result code from the portal ('9401') 2019-03-04 01:06:38.084 xcodebuild[62700:9920056] DVTPortal: Error: Error Domain=DVTPortalServiceErrorDomain Code=9401 "An App ID with Identifier 'com.YourID.gallery-mobile' is not available. Please enter a different string." – Oscar Mar 04 '19 at 09:10
0

Yes you can pass data from your .pro project file to your Info.plist. When you run QMake, this builds your Xcode project file and passes through the settings for Xcode. So it is QMake that's important, rather than Qt Creator.

There have, unfortunately, been changes and bugs (e.g. QTBUG-70072) and there are also omissions from the documentation.

As of Qt 5.11.2, here is how to set the bundle (and some other fields):

QMAKE_INFO_PLIST = path/to/your/Info.plist
QMAKE_TARGET_BUNDLE_PREFIX = com.yourcompany
QMAKE_BUNDLE = yourapp
QMAKE_IOS_DEPLOYMENT_TARGET = 11.0
QMAKE_APPLE_TARGETED_DEVICE_FAMILY = 1

If you don't set QMAKE_BUNDLE, QMake will use your TARGET. In my case, my app bundle ID is all lowercase whereas my TARGET is not, and the bundle is case-sensitive.

QMAKE_IOS_DEPLOYMENT_TARGET sets the minimum iOS version.

QMAKE_APPLE_TARGETED_DEVICE_FAMILY sets the device family: 1 for iPhone, 2 for iPad, 1,2 to support both.

Within your Info.plist, you should have:

<key>CFBundleIdentifier</key>
<string>${PRODUCT_BUNDLE_IDENTIFIER}</string>

The official documentation relating to Info.plist is on the QMake Variables Reference page.

Paul Masri-Stone
  • 2,843
  • 3
  • 29
  • 51