macOS universal binary: repeated Documents access requests
-
Greetings!
I'm building an app using Qt Creator 10.0.1 on macOS Monterey (12.6.1), running on Apple Silicon, and Qt 6.5.1. The app uses several non-Qt shared libraries.
When I build an arm64 app, everything works fine. It asks me for permission to access the Desktop and Documents folder the first time I invoke an Open File dialog, and then never again.
When I build a universal app (arm64 and x86_64), the app works, but I get many superfluous requests to grant access to those folders. On the first launch and attempt to open a file, it asks for each of these at least twice (in a row, popping alerts each time). When I relaunch and open, it asks again. I also observed it asking even when invoking the Open dialog more than once during a launch. It was even worse (more redundant) on a different M1 Mac running the same OS. After the first time I grant permission, the System Prefs security pane for Files and Folders shows what you would expect, and it continues to look that way throughout all this alert popping.
I request the universal build by using this in my .pro file:
QMAKE_APPLE_DEVICE_ARCHS = x86_64 arm64
I don't do anything else. My 3 non-Qt dylibs are all universal. To deploy, I run my own shell script that invokes macdeployqt, fixes up some dylib naming issues, and finishes creating the app bundle.
Note that this is not Qt Creator asking for Desktop/Documents folder permission. There was at least one thread on this forum about that. For what it's worth, the same behavior happens even after signing and notarizing the app.
Does anyone have insight into this behavior?
John
-
Greetings!
I'm building an app using Qt Creator 10.0.1 on macOS Monterey (12.6.1), running on Apple Silicon, and Qt 6.5.1. The app uses several non-Qt shared libraries.
When I build an arm64 app, everything works fine. It asks me for permission to access the Desktop and Documents folder the first time I invoke an Open File dialog, and then never again.
When I build a universal app (arm64 and x86_64), the app works, but I get many superfluous requests to grant access to those folders. On the first launch and attempt to open a file, it asks for each of these at least twice (in a row, popping alerts each time). When I relaunch and open, it asks again. I also observed it asking even when invoking the Open dialog more than once during a launch. It was even worse (more redundant) on a different M1 Mac running the same OS. After the first time I grant permission, the System Prefs security pane for Files and Folders shows what you would expect, and it continues to look that way throughout all this alert popping.
I request the universal build by using this in my .pro file:
QMAKE_APPLE_DEVICE_ARCHS = x86_64 arm64
I don't do anything else. My 3 non-Qt dylibs are all universal. To deploy, I run my own shell script that invokes macdeployqt, fixes up some dylib naming issues, and finishes creating the app bundle.
Note that this is not Qt Creator asking for Desktop/Documents folder permission. There was at least one thread on this forum about that. For what it's worth, the same behavior happens even after signing and notarizing the app.
Does anyone have insight into this behavior?
John
Hi,
Based on another thread where the OP also had issues with dialogs, you should double check the
Info.plist
content of your application to ensure all the values are correctly formatted and valid. -
Hi,
Based on another thread where the OP also had issues with dialogs, you should double check the
Info.plist
content of your application to ensure all the values are correctly formatted and valid.@SGaist Thank you, that's a great idea. I'm not really sure what I might need here. Below is my plist as converted by plutil. It checks out using the -lint flag of plutil.
I see now that the value of LSMinimumSystemVersion is not consistent with that of QMAKE_MACOSX_DEPLOYMENT_TARGET, which by default is 11.0 currently. I think I'll fix this first!
If anyone sees anything else suspicious, including necessary things that are missing, please let me know.
John
{ "CFBundleDisplayName" => "RTcmixShell" "CFBundleDocumentTypes" => [ 0 => { "CFBundleTypeExtensions" => [ 0 => "sco" ] "CFBundleTypeRole" => "Editor" } ] "CFBundleExecutable" => "RTcmixShell" "CFBundleIconFile" => "RTcmixShell.icns" "CFBundleIdentifier" => "org.rtcmix.RTcmixShell" "CFBundleName" => "RTcmixShell" "CFBundlePackageType" => "APPL" "CFBundleShortVersionString" => "1.1.1" "CFBundleVersion" => "1.1.1" "LSMinimumSystemVersion" => "10.13" "NSHighResolutionCapable" => 1 "NSHumanReadableCopyright" => "Copyright 2017-2023 John Gibson at al." "NSMicrophoneUsageDescription" => "RTcmixShell needs access to the microphone in order to play and record audio." "NSPrincipalClass" => "NSApplication" }
-
Greetings!
I'm building an app using Qt Creator 10.0.1 on macOS Monterey (12.6.1), running on Apple Silicon, and Qt 6.5.1. The app uses several non-Qt shared libraries.
When I build an arm64 app, everything works fine. It asks me for permission to access the Desktop and Documents folder the first time I invoke an Open File dialog, and then never again.
When I build a universal app (arm64 and x86_64), the app works, but I get many superfluous requests to grant access to those folders. On the first launch and attempt to open a file, it asks for each of these at least twice (in a row, popping alerts each time). When I relaunch and open, it asks again. I also observed it asking even when invoking the Open dialog more than once during a launch. It was even worse (more redundant) on a different M1 Mac running the same OS. After the first time I grant permission, the System Prefs security pane for Files and Folders shows what you would expect, and it continues to look that way throughout all this alert popping.
I request the universal build by using this in my .pro file:
QMAKE_APPLE_DEVICE_ARCHS = x86_64 arm64
I don't do anything else. My 3 non-Qt dylibs are all universal. To deploy, I run my own shell script that invokes macdeployqt, fixes up some dylib naming issues, and finishes creating the app bundle.
Note that this is not Qt Creator asking for Desktop/Documents folder permission. There was at least one thread on this forum about that. For what it's worth, the same behavior happens even after signing and notarizing the app.
Does anyone have insight into this behavior?
John
@jgibson If it keeps asking for permissions there might be a problem with code signing of your app.
I would trycodesign -s - --deep <MyApp>.app
and see if it fixes the problems on your machine. If you move it to another machine you will have to do it there again because it will have an ad-hoc signature which is not transferable.