Intermittent problem with macdeployqt
-
Can you check with a more recent version of Qt ? IIRC the current is 5.9.3 but you can also test 5.10
-
I downloaded and tried 5.4. This fails with
This application failed to start because it could not find or load the Qt platform plugin "cocoa" and that is running under Qt Creator.
I tried the complete download/install on this twice. I'll go back to 5.9.3.
Wesley -
Is your code available somewhere to test the deployment ?
-
The source code is not on a public cloud at the moment, but I'll be glad to send it to you. But how do we do it without making our actual email addresses public? I have used Wetransfer and Dropbox both.
@Kasungu This may be a stupid question, but are you sure, that you use the correct macdeployqt-tool ?
Each installation of Qt - 5.9.3, 5.92, 5.4 etc. - each come with their own deploy-tool. If you're using the 5.4 tool for a 5.9.3 binary, than theres a high chance that it won't work.
A file is copied into the folder, but the wrong one.
-
It was a great idea! I was excited, but I checked and unfortunately I had done it right. But I double-checked, made sure no other versions of Qt existed, rebuilt using the version of Creator which was in 5.9.3, etc. It still fails in the same way.
(By the way, when I run the version of Creator in 5.9.3, and hit About Creator, I get
"Based on Qt 5.9.2". I presume this is because Creator did not change between 5.9.2 and 5.9.3, and this message didn't get changed. Right?)Sigh..
-
It was a great idea! I was excited, but I checked and unfortunately I had done it right. But I double-checked, made sure no other versions of Qt existed, rebuilt using the version of Creator which was in 5.9.3, etc. It still fails in the same way.
(By the way, when I run the version of Creator in 5.9.3, and hit About Creator, I get
"Based on Qt 5.9.2". I presume this is because Creator did not change between 5.9.2 and 5.9.3, and this message didn't get changed. Right?)Sigh..
@Kasungu said in Intermittent problem with macdeployqt:
"Based on Qt 5.9.2".
Means what Qt Creator was build with and it is not related to the version of Qt
you are using to build your application.
In fact you can have multiple version of Qt installed and use in the same Creator. -
I found the fix! all it required was the correct switch used withmacdeployqt:
/Users/[PathtoQt]/Qt/5.9.3/clang_64/bin/macdeployqt [space] /Users/[pathtoapp]/ThisApp.app - [note the dash] executable=/Users/[pathtoapp]ThisApp.app/Contents/MacOS/ThisApp
The online manual says this about that switch:
-executable=<path> Let the given executable also use the deployed frameworks
Perhaps this could be described a bit more clearly, since if you do this, all the stuff using Install_name_tool isn't needed. (Finding this took me weeks). Of course, I am not a Qt guru, maybe it's just me.
-
It's a bit surprising, in most cases you shouldn't need that option.
Anyway, glad you found out and thanks for sharing ! :)