Mac deployment issues
-
Hello, I'm having issues uploading macOS app to appstore after I deploy, sign and package it. I'm using Qt 5.14.2 and MacOS Monterey 12.5
The steps I take are:- Build a release build of MyApp. I can open the MyApp.app file and it works without any issues.
If I run xcrun altool --validate-app right after building a release build, with arguments: --type macos --username appleid --password somepassword --file /Path/To/MyApp.app, I get a "Could not find the main bundle or the Info.plist is missing a CFBundleIdentifier".
I've checked MyApp.app/Contents/Info.plist, and it does contain the correct CFBundleIdentifier value. I've tried setting QMAKE_TARGET_BUNDLE_PREFIX and custom QMAKE_INFO_PLIST file in the .pro file, but the error stays the same.- I run the appropriate version macdeployqt executable with these arguments: path to MyApp.app -qmldir -codesign=(id i've found using "security find-identity -v -p codesigning" command).
It passes without any errors. I check the signing using "codesign -dv /Path/To/MyApp.app" command and it returns signing info.
If I run xcrun altool --validate-app with the very same arguments after this step, I get different errors: "The Info.plist in the package must contain the CFBundleVersion .. " and ".. CFBundleShortVersionString key".
I've added "VERSION = 1.2.3" and when I repeat these steps I can see that MyApp.app/Contents/Info.plist does contain CFBundleVersion and CFBundleShortVersionString values, but xcrun altool --validate-app still returns me the very same error.- If I try to ignore the errors and build a package using "productbuild --sign=(id I get with "security find-identity" command) --component /Path/To/MyApp.app /Applications MyApp.pkg" arguments, I do get a MyApp.pkg file, but when I try to upload it to a Transporter app, I get an "Failed to get the app's bundle id", even though CFBundleIdentifier is present in MyApp.app/Contents/Info.plist.
I've tried to compare and merge an XCode macos project generated Info.plist file, yet the error message remains the same.
Any idea what could I be doing wrong? -
Hi,
Are you hitting the same issues if you use a more recent version of Qt ?
-
Hello @SGaist,
I've tried to do the same steps with the same "xcrun altool --validate" command and "macdeployqt" executable appropriate to each version, on Qt 5.15.2 and 6.3.1 versions.Qt 6.3.1 "xcrun altool --validate-app" command returns the exact same errors as 5.14.2 (before and after macdeployqt).
However Qt 5.15.2 calling "xcrun altool --validate-app" before macdeployqt returns the same error
Could not find the main bundle or the Info.plist is missing a CFBundleIdentifier
but when I call "xcrun altool --validate-app" after calling macdeployqt, the error I get:
No suitable application records were found. Verify your bundle identifier 'org.qt-project.QtQuickControls2' is correct and that you are signed into Xcode with an Apple ID that has access to the app in App Store Connect
even though I'm using the same Info.plist file.
-
Are you getting these error with a default application as well ?
If so, can you provide a minimal bash script that applies the steps you use so we can test it ?
-
@SGaist, sorry for the late reply.
I've created a default Qt project and tested my cases on Qt 6.3 and 5.14.2.
The errors I get when I run xcrun altool after macdeployqt is different from the one I get on my main project. I've tried multiple variations, but the error message wouldn't change.The exact steps I take:
- Create an app identifier in developer.apple.com, that will match my application. (You're going to need an apple developer account for this, and some further actions in shell commands)
- Build a release build of my app.
- Shell commands I run (I had to replace paths and some personal identification details):
xcrun altool --validate-app --type macos -username YourAppleId --password YourApplePassword --file /Path/To/Build/QtTestApp.app #After running xcrun altool command the first time, I'd get "Could not find the main bundle or the Info.plist is missing a CFBundleIdentifier" error. #Path to macdeploy is ussualy: ~/QtInstallationDir/QtVersion/macos/bin #To get codesign value you'd have to run "security find-identity -v -p codesigning" command and copy your apple developer account id (40 chars length, made up of random chars and numbers) /Path/To/macdeployqt /Path/To/Build/QtTestApp.app -qmldir=/Path/To/Project/QtTestApp -codesign=somecode #Returns app signing info, if signing was succesful during deployment codesign -dv /Path/To/Build/QtTestApp.app xcrun altool --validate-app --type macos -username YourAppleId --password YourApplePassword --file /Path/To/Build/QtTestApp.app #Running this command after macdeployqt, errors I'd get: #Qt5.14.2: "No suitable application records were found. Verify your bundle identifier 'org.qt-project.QtPrintSupport' is correct and that you are signed into Xcode with an Apple ID that has access to the app in App Store Connect."" #Qt6.3: "No suitable application records were found. Verify your bundle identifier 'org.qt-project.QtQuickControls2' is correct and that you are signed into Xcode with an Apple ID that has access to the app in App Store Connect."
Default project that I've used link.
If you don't wan't to download it, it's just a default Qt app with this code added in .pro file:#QMAKE_INFO_PLIST = Info.plist #Tried using XCode generated Info.plist file QMAKE_TARGET_BUNDLE_PREFIX = com.company #To change app identifier prefix, so it would match in apple identifiers database
and Info.plist file copied from a default XCode macos project.
-
Sorry, I have had issues with Xcode recently and couldn't check this.
In between, did you check the bug report system to see if there's something related there ?
-
It is worth I think especially if you can't find anything related to it there.