[solved] Unable to deploy Qt Quick 2 application on Mac OS X 10.8.2
-
Hey,
This is working solution for deploying QML applications on MAC OS X: https://github.com/MaximAlien/macdeployqtfixed.git
Hope it helps you guys.
-
hi Maxim, is there any way to get it works with QT 5.1 ?
Struggling with the same issues, can't deploy QtQuick app on Mac
-
Hey,
Did you test code I provided? I tried deploying it for Qt 5.1 only once and there were some issues with paths. I'll try it more this evening.
If I manage to deploy it correctly I'll write here.
Cheers,
Max. -
I'm testing it know, there is issue with a path, but I'm applying work around I described "here":http://stackoverflow.com/a/17591828/2370437
If I will manage to deploy, I will post here
-
Does not work for me.
macdeployqt MyApp.app/ -qmldir=../src/qml/
dynamic links information is changes inside executable and QtQuick modules were copied into the app bundle, near executable. But still getting an error:
main.qml:1 module "QtQuick" is not installed
Maybe it is connected with QML_IMPORT_PATH variable, or we need to specify somehow where application can find QtQuick modules
-
"Try this":https://codereview.qt-project.org/#change,47906.
-
You suggested this hint sierdzio, thanks.
I tried it a couple of months ago and it doesn't work for me, even more it was updated Mar 19, 2013 9:43 AM, before Qt 5.1 release.
Cheers,
Max. -
Yeah, not sure why Ivan suddenly went silent on this.
-
miks131 you can try setting QML2_IMPORT_PATH in application pro file, this may help.
-
I'm using CMake ( have a lot of different components)
Made a quick check.
Tried to add a link to the directory which contains QtQuick and QtQuick.2 folders after deploy.@engine.addImportPath( QLatin1String("/Users/username/Projects/MyApp/bin/MyApp.app/Contents/MacOS/") );@
Does not work, the same result if I specify two path to QtQuick and QtQuick.2 folders
-
Path is correct for QML plugins.
Did you try copying all frameworks and plugins manually? -
Looks like macdeployqt needs to be slightly changed for Qt 5.1 because using otool utility for dependencies search before and after macdeployqt nothing changes.
App still uses dependencies from system, not in bundle.
-
There is another bug - executable contains doble slash in path to Qt dynamic libraries. Take a look here https://bugreports.qt-project.org/browse/QTBUG-32379
That's why macdeployqt does not change links. But you can work it around. Just use install_name_tool to get rid of double slashes, before you run macdeployqt.
Well, I did try to copy QtQuick modules manually too.
But not a frameworks, there are a lot of dependencies with linking which has to be resolved by install_name_tool - to get a self contain app bundle. So I'm using macdeployqt for copying Qt Framework.
-
I see. Thanks
I'll try to check it this evening.
-
OK,
there are still troubles even with this work around.
The thing is that there are a lot of dependencies between Qt libraries. For example QtQML depends on Network, Core, V8 ( you can check that by running otool -L ). So QtQML links with them dynamically. macdeployqt suppose to resolve linking paths, from absolute once to relatives. Because we copied all libs inside app bundle. But it does not do it, because of doble slash inside paths for QtQml for example:
@otool -L QtQml /Users/username/Qt5.1.0//5.1.0/clang_64/lib/QtNetwork.framework/Versions/5/QtNetwork )@
So path to QtNetwork was not changed, and it means bundle will not be distributable, since it depends on absolute paths.
In general deployment of QtQuick modules is a bigger problem, because dynamic linking paths could be modified manually with install_name_tool and there is a "documentation":http://qt-project.org/doc/qt-5.0/qtdoc/deployment-mac.html how to do so.
But there is not any documentation how to deploy QtQuick modules : /
I wrote an email to Qt-Components mailing list, maybe someone will provide useful tip. -
So the same story with libraries inside QtQuick and QtQuick.2 folders, it is not enough just copy them inside app bundle.
Dynamic linking paths inside libs has to be modified to a relative once with install_name_tool
-
"This script":https://gist.github.com/lasconic/5965542 will help to fix duble slashes within QT
-
This bug reported since Qt5.0.1 come out
"bug report":https://bugreports.qt-project.org/browse/QTBUG-29495Until now, we still don't get a useable macdeployqt nor any document
show us how to deploy QtQuick2 projects on mac, maybe even the
developers also don't know how to do it?After I copy the QtQuick2 and QtQuick folders into the plugins folder of the bundle
I run the otool -L on each dylib, the path are relative but not absolute, so what is wrong?
Something haven't changed?Or I missing some dylib?@
libqtquick2plugin.dylib (compatibility version 0.0.0, current version 0.0.0)
@executable_path/../Frameworks/QtQuick.framework/Versions/5/QtQuick (compatibility version 5.1.0, current version 5.1.0)
@executable_path/../Frameworks/QtQml.framework/Versions/5/QtQml (compatibility version 5.1.0, current version 5.1.0)
@executable_path/../Frameworks/QtNetwork.framework/Versions/5/QtNetwork (compatibility version 5.1.0, current version 5.1.0)
@executable_path/../Frameworks/QtCore.framework/Versions/5/QtCore (compatibility version 5.1.0, current version 5.1.0)
@executable_path/../Frameworks/QtGui.framework/Versions/5/QtGui (compatibility version 5.1.0, current version 5.1.0)
/System/Library/Frameworks/OpenGL.framework/Versions/A/OpenGL (compatibility version 1.0.0, current version 1.0.0)
/System/Library/Frameworks/AGL.framework/Versions/A/AGL (compatibility version 1.0.0, current version 1.0.0)
/usr/lib/libc++.1.dylib (compatibility version 1.0.0, current version 19.0.0)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 159.1.0)
@ -
Hej, managed to get it work, checkout this "answer":http://stackoverflow.com/a/17591828/2370437
-
@MaximAlien great job with macdeployqt on GitHub! Thanks a lot. It works with QT 5.1 after I fixed double slashes with script I mentioned above.
Maybe it is a good idea update README on GitHub