Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct
Upgrading to 5.5 on Mac causes cocoa error
We have an application, HTML5 project type. Developed using Xcode by using the Qt provided script to convert a Creator project.
The app was started on 5.3. Upon release of 5.4, I was able to switch with a simple perl expression on my project folder:
perl -p -i -e 's//5.3///5.4//g;'
grep -ril --exclude=*.o /5.3/ *
I tried doing this the last couple days to update to 5.5. The first problem I ran into was a complaint about not finding QtWebChannel, something we never needed before, but fine, I added the framework to the project.
After that, I'm stuck on the following no matter what I do (this is just running from Xcode, no exported bundle yet):
This application failed to start because it could not find or load the Qt platform plugin "cocoa".
Available platform plugins are: cocoa, minimal, offscreen.
Reinstalling the application may fix this problem.
Ive searched and searched and all the related answers have to do with final bundle, this is something to do with 5.5 specifically.
I can use the same command to switch back to 5.3 or 5.4 and everything works again, both running from Xcode and a final exported application bundle. So what's changed in 5.5 that I'm missing? Thanks.
IIRC, the runtime path handling has changed. Take a look with
otool -Lto your Qt libraries.
You are correct. If I run otool -L on 5.3 or 5.4, I get full path. If i run it on 5.5 frameworks, I get @rpath
However, I still can't figure out what/how to change to solve for this. I already have a script I run on final app bundles to fix them for deployment that changes everthing to @executable_path but it still doesn't work with 5.5
After my script, I can check with otool -L and everything looks great, same error. Ideas? I'll go through one by one and see if maybe something's off I suppose.
Did you also go through all the plugins ?
Not sure how to mark solved, but I figured it out going one by one. It wasn't the paths in the libraries, it turns out in 5.5 I also need QtDBus now. once I added that to the project and cleaned, everything works.
What triggered the DBus dependency ?
If the Topic Tools button doesn't allow that, then just edit the thread title prepending [solved] and your good