Qt Creator 4.0.2 + Xcode Version 8.1 (8B62) Build for iOS fails
-
Not sure if this is well known or not and wether there is a work around but I am unable to build and deploy to an iOS device or the simulator from within Qt5.7 (Creator version 4.0.2) and Xcode Version 8.1
As for the simulator, no selectable devices show up in the Project Run Settings -> Device Type.
Under Preferences->Build&Run->Kits, iphonesimulator-clang Qt 5.7.0 for iOS shows a warning "Device type is not supported by Qt version".
Under Preferences->Build&Run->Qt Versions, Qt 5.7.0 for iOS shows a warning "Not all possible target environments can be supported due to missing compilers"
However, Under Preferences->Devices, the iOS Simulator does show a green lit "Ready to Use".
*The only way I can build an iOS project and deploy it to a device or the simulator is to run qmake from QtCreator and then open and run the project from within Xcode.
Is there a known workaround to this issue?
-
Hi!
Do you see any other errors when building the project from within Qt Creator?
E.g. if you get this error with XCode 8:
"Project ERROR: Xcode not set up properly. You may need to confirm the license agreement by running /usr/bin/xcodebuild."
you can have a look at the answers here to solve it: http://stackoverflow.com/questions/39544135/qt-does-not-work-since-xcode-8Also, did you set up the compilers/build kits manually or are they auto-detected? Maybe something went wrong there that can be fixed by deinstalling and reinstalling Qt for iOS with the MaintenanceTool. Qt Creator should auto-detect and setup the Kits after the installation. (Close Qt Creator during and reopen then after the installation)
Best,
Günther -
Hi!
Do you see any other errors when building the project from within Qt Creator?
E.g. if you get this error with XCode 8:
"Project ERROR: Xcode not set up properly. You may need to confirm the license agreement by running /usr/bin/xcodebuild."
you can have a look at the answers here to solve it: http://stackoverflow.com/questions/39544135/qt-does-not-work-since-xcode-8Also, did you set up the compilers/build kits manually or are they auto-detected? Maybe something went wrong there that can be fixed by deinstalling and reinstalling Qt for iOS with the MaintenanceTool. Qt Creator should auto-detect and setup the Kits after the installation. (Close Qt Creator during and reopen then after the installation)
Best,
Günther@GTDev Yes I have been through that license agreement error and that page already. This is a different issue.
When building for OS X , I get the following error:
Qt5.7.0/5.7/clang_64/lib/QtCore.framework/Headers/qsystemdetection.h:95:12: fatal error: 'TargetConditionals.h' file not found
And I am able to resolve this problem by adding QMAKE_MAC_SDK = macosx1 .12 to my .pro file.
But on iOS when I build for the simulator and select iPhone 6 as a device type, I get:
xcodebuild: error: Unable to find a destination matching the provided destination specifier: { id:12.9 inch } Unsupported device specifier option. The device “My Mac” does not support the following options: id Please supply only supported device specifier options.
And when I build for an actual device (iPhone 6 Plus) I get:
Signing for "ExampleApp" requires a development team. Select a development team in the project editor. Code signing is required for product type 'Application' in SDK 'iOS 10.0'
So I have to open the project in Xcode and select a team and then build directly from there.
-
@GTDev Yes I have been through that license agreement error and that page already. This is a different issue.
When building for OS X , I get the following error:
Qt5.7.0/5.7/clang_64/lib/QtCore.framework/Headers/qsystemdetection.h:95:12: fatal error: 'TargetConditionals.h' file not found
And I am able to resolve this problem by adding QMAKE_MAC_SDK = macosx1 .12 to my .pro file.
But on iOS when I build for the simulator and select iPhone 6 as a device type, I get:
xcodebuild: error: Unable to find a destination matching the provided destination specifier: { id:12.9 inch } Unsupported device specifier option. The device “My Mac” does not support the following options: id Please supply only supported device specifier options.
And when I build for an actual device (iPhone 6 Plus) I get:
Signing for "ExampleApp" requires a development team. Select a development team in the project editor. Code signing is required for product type 'Application' in SDK 'iOS 10.0'
So I have to open the project in Xcode and select a team and then build directly from there.
@Tavis If I switch to Xcode 7.3 I can then build and run in the Simulator but I cannot deploy to a device running the latest iOS 10.
SO what I am doing now is developing in Xcode 7.3 so I can run in the simulator and os x and then when I want to run it on an actual device, I switch to Xcode 8.1, run Qmake, open the project in Xcode 8.1 and then build and run on the device.
-
@Tavis If I switch to Xcode 7.3 I can then build and run in the Simulator but I cannot deploy to a device running the latest iOS 10.
SO what I am doing now is developing in Xcode 7.3 so I can run in the simulator and os x and then when I want to run it on an actual device, I switch to Xcode 8.1, run Qmake, open the project in Xcode 8.1 and then build and run on the device.
Using Qt Creator 4.1.0 here, Xcode 8.1 on OSX El Capitan (10.11.6). Haven't been able to deploy to iOS device nor to iOS simulator from Qt Creator either. What I do is run qmake to generate a .xcodeproj and then build/deploy from Xcode directly.
Problem:
xcodebuild: error: Unable to find a destination matching the provided destination specifier:
{ id:12.9 inch }Solution:
Assuming you have Qt installed on your disk in the following location "/Development/Qt/5.7"
nano /Development/Qt/5.7/ios/mkspecs/macx-ios-clang/xcodebuild.mk
comment out this line:
IPHONESIMULATOR_GENERIC_DESTINATION := "id=$(shell xcrun simctl list devices | grep -E 'iPhone|iPad' | grep -v unavailable | perl -lne 'print $$1 if /((.*?))/' | tail -n 1)"
and add this one instead:
IPHONESIMULATOR_GENERIC_DESTINATION := "id=$(shell xcrun simctl list devices | grep -E 'iPhone|iPad' | grep -v unavailable | awk 'match ($$0, /(([A-F0-9-]*))/ ) { print substr ($$0, RSTART+1, RLENGTH-2) }' | tail -n 1)"
Problem:
Signing for "ExampleApp" requires a development team. Select a development team in the project editor.
Code signing is required for product type 'Application' in SDK 'iOS 10.0'Solution:
-
Fire up Qt Creator, open your project, right click it and select "Run qmake" on it.
-
In Xcode, navigate to you project's folder and open the .xcodeproj file qmake just generated.
-
Once the project is loaded in Xcode, click on your project (left pane) and the Project Editor should be active in the right pane now. It has the following options: "General" "Capabilities" "Resource Tags" "Info" "Build Settings" "Build Phases" "Build Rules".
-
In "General" - Signing section check "Automatically manage signing" and click on the "Team" dropdown menu. Select "Add account " and use your Apple Id. After you do that, the "Team" dropdown will contain a default team linked to your account. Select it to deploy to your devices.
I hope that was of help and not too confusing, since I'm quoting from memory now.
-
-
I tried replacing this:
IPHONESIMULATOR_GENERIC_DESTINATION := "id=$(shell xcrun simctl list devices | grep -E 'iPhone|iPad' | grep -v unavailable | perl -lne 'print $$1 if /((.*?))/' | tail -n 1)"
with this:
IPHONESIMULATOR_GENERIC_DESTINATION := "id=$(shell xcrun simctl list devices | grep -E 'iPhone|iPad' | grep -v unavailable | awk 'match ($$0, /(([A-F0-9-]*))/ ) { print substr ($$0, RSTART+1, RLENGTH-2) }' | tail -n 1)"
But I now get the following error:
xcodebuild: error: missing value for key 'id' of option 'Destination'
The problem is there is no device list appearing in the popup menu under the simulator run settings..
Your work around for deploying to an actual device is what I am already doing.. That is the issue I was initially reporting.. The problem I have with that is every time I rebuild the project I have to reopen the xcodeproj and reselect my account as the "Team" and run within Xcode. Each build wipes out the team selection for signing.