Qt 5.2 beta 1 / iOS / QtQuick 1.1 and 2.0
-
For the people that have successfully tried this workaround...are you deploying to an actual device or the iOS Simulator? For me, this works fine on the device, but when I try to compile for the simulator I get a ton of 'duplicate symbol' linker errors. Seems to be lots of conflicts between Qt5Qml/Qt5Quick and Qt5Declarative. Has anyone else run into this or have suggestions for fixing it?
-
@ dbrian: not sure if you are aware, but if you want to run this on the simulator, you'll have to run qmake from Qt 5.2.0 (ios_x86), while if you want to run on an actual device, you need to run qmake from Qt 5.2.0 (ios_armv7) tool chain.
@Gianluca: Yes that worked perfectly, i was finally able to run a QtQuick2 application.
Now the bad part is, for some reason it stopped working for any Qt application beginning of this month, I thought my tool chain was broken, so I restored my Mac via "Time Machine" to a point, when the toolchain definitively worked, but no success. I was able to run the app via XCode on the device, and once done, I could start that same app again, but I when I created an IPA using a provisioning profile, the IPA did install on the device, but when started, the only thing was the black screen and then the app stopped. Console log showed exited abnormally with exit status 255. This was with qt-mac-opensource-5.2.0-beta1-ios-x86_64-offline_2013-10-23_08-56-32-110.dmg .
Weird... the only change I did on Apple side, I had to change/update a provisioning profile. I am still able to successfully deploy and start native iOS apps, so it's not a matter of corrupted provisioning profiles. They just seem to have stopped working with Qt apps...So I tried the latest build qt-mac-opensource-5.2.0-beta1-ios-x86_64-offline_2013-11-05_13-03-56-133.dmg , now the app deploys correctly and starts up, but now it stalls with a black screen, on the debug output is the message Failed to find shader ":/scenegraph/shaders/opaquetexture.vert" .
-
For what it's worth, here is another workaround I figured out that doesn't require any changes to your .pro file or source code.
Create a .qml file in the same directory as your .pro file where you declare any qml imports your application requires.
@
/*
imports.qmlDeclaration of QML Imports required by project. This is necessary if we want to keep qml files in a folder separate from .pro file because of the way qmlimportscanner works. If these imports are not declared, qmake will not recognize them, and QtQuick will not be packaged with statically built apps (i.e. iOS) and imported at runtime. This must be kept in the same directory as your .pro file
*/
import QtQuick 2.1
import QtQuick.Window 2.1
//import etc, etc, etc.QtObject {}
@I came to this solution because I found that I was able to build/deploy most of the example QtQuick2.0 apps to a device/simulator without any issue, but my own apps were throwing a 'QtQuick not installed' error on deployment. This seemed really strange to me so I dug into the source and found that qmake uses a tool called qmlimportscanner and attempts to locate any qml imports by parsing qml files in the directory of the .pro file for 'import ...' statements. Then qmake automatically sets up the appropriate lib dependencies for static builds. Since I like to keep my .qml files in a separate directory, qmake didn't know I had dependencies on the QtQuick plugins. Putting this file there helps qmake figure out what libraries/plugins it needs to bundle with your app
Hopefully this helps someone. If you want to look into it yourself, the relevant qmake code is in qt.prf (search for '# static builds: link qml import plugins into the app.').
-
i am having the same issue than edmon. I tried and tried look and look but always the same result. When I run the app with qt creator everithing works perfect but if I try to generate the .IPA file and install the app with iTunes. Always the same result, black screen for few seconds and then closes in the console it says : exited abnormally with exit status 255
I tried with several versions and different configurations in XCode, could somebody give me a hint.I really dont know where even keep looking for the info.
Thanks
-
Hi devuser,
I found out the for some reason some Qt builds were somehow broken, running on simulator and running on the device through XCode was working fine, but when installed from an IPA, it did not, so I went back and tested for older Qt builds. I found the following builds to be working with IPA installation:
- Build 104: qt-mac-opensource-5.2.0-beta1-ios-x86_64-offline_2013-10-18_08-24-56-104.dmg
- Build 106: qt-mac-opensource-5.2.0-beta1-ios-x86_64-offline_2013-10-20_13-21-35-106.dmg
I foung e.g. Builds 109 and 110 not to be working with IPA deployment. I recently did not have the chance to test for newer builds, as of today it looks like Builds 135 and later are available on the "beta1":http://download.qt-project.org/snapshots/qt/5.2/5.2.0-beta1/ path, and there is also now the "rc1":http://download.qt-project.org/snapshots/qt/5.2/5.2.0-rc1/ path available, you may want to try those.
-
After installing the Qt5 package, the following toolchains are available:
Qt 5.2.0 (ios_x86): use this tool chain if the resulting code is supposed to be tested with XCode's device simulator
Qt 5.2.0 (ios_armv7): use this tool chain if the resulting code is supposed to be tested or to be deployed to an actual device
Here is the proceeding as I use to generate the IPA:
open your Qt project with QtCreator
make the adaptions if using QtQuick2 (Gianluca's solution as of October 30, 2013)
select the appropriate tool chain for the intended purpose, i.e. for generating simulation or deployment code
run qmake from QtCreator's menu. This will create a shadow build for the selected tool chain containing an XCode project file, e.g. MyProject.xcodeproj
open that generated XCode project file, this will invoke XCode
in the Summary tab in section iOS Application Target, change the Bundle identifier to your need, currently it defaults to com.yourcompany.<appname>. This is imoportant for deployment to match the app with a defined App ID in the Apple Developer Member Center
change other app specific settings if needed, e.g. the supported device orientation
start compilation from within XCode
continue as for a standard (native) iOS application, either run it on simulator, run it on a connected device or deploy it (generate an IPA file)
To generate the IPA (the following is valid for XCode 4.6.3):
build and archive the code in XCode
switch to XCode Organizer into Section "Archives"
select the archive you just generated and click on the button "Distribute..."
select the intended method of distribution, e.g. "Save for Enterprise or Ad-Hoc Deployment" and click "Next"
select the "Code Signing Identity" and click "Next"
select a location to store the generated IPA file
VoilĂ , there is your IPA file
-
For what it's worth, I just ran into this problem out of the blue (despite having previously had QML stuff working on the iPad simulator) after I nuked a build area. (On MacOS 10.8 using the Qt5.2.1 for ios).
One thing which had changed in the development area's history: I'd moved the qml files into a subdirectory (relative to the .pro file).
I just followed dbrian's advice and created a near identical imports.qml adjacent to the .pro... and ta-da... back in action again.
-
@dbrian said in Qt 5.2 beta 1 / iOS / QtQuick 1.1 and 2.0:
Create a .qml file in the same directory as your .pro file where you declare any qml imports your application requires
Amazing. It is now 2020 (7 years have passed), and this "imports.qml" trick still solved my iOS/qmake issue today. Thanks, from the future ;)