iOS kit not detected on Qt (macOS) - c++

I am currently trying to port an android application on iOS. The application was developped on Linux. But I can't manage to use Qt on macOs for iOS developpement.
I followed those (rather unclear) instructions : http://doc.qt.io/qt-5/ios-support.html
First, I installed successfully XCode and I managed to deploy a dummy app on my iPhone. Then, I installed Qt and opened the ".pro" project file.
But the only kit I can use is "Desktop Qt 5.4.1 clang 64 bit". The kits for iOS don't seem to be detected.
Did I do something wrong ? Am I missing something ?
EDIT:
When I launch the ".pro", I got this error :
Project ERROR: Xcode not set up properly. You may need to confirm the license agreement by running /usr/bin/xcodebuild.
Unfortunately, it is NOT related to this well known issue (Qt Creator - Project ERROR: Xcode not set up properly. You may need to confirm the license agreement by running /usr/bin/xcodebuild)
When I run the command :
/usr/bin/xcodebuild
I get this error:
xcodebuild: error: The directory /Users/<UserName> does not contain an Xcode project

Okay I managed to solve my problem by re installing Qt with version 5.8 (instead of 5.9.1).
But I am not sure this is what was causing the issue though. In deed, I realized I installed Qt prior to configuring XCode the first time(with my Developer Account).

Related

Why can't I run a QT project on an IOS emulator?

I am trying to make an iOS app on my macbook with the M1 chip. Downloaded Qt, installed, created a project, click run on the emulator and here:
error screen
XCode had previously run a test project and everything works fine on the emulator there, and a ton of errors come out on Qt. As I understand it, Qt doesn't see any necessary files, but I don't even understand where to get them from. I want to note that if you run the application not on the emulator, but on the Mac itself, then everything works fine.
I'm sorry for my English, I used a translator.
What version of Qt are you using ? What about xCode ?
You have to download just only Qt 5.5.0 for Android and iOS (Mac, 1.7 GB) file from https://www.qt.io/download-open-source/ and install it.
When it is completely installed,
Set the environment for android development. Open up the terminal and execute following commands
export ANDROID_HOME=/Users/graphics/Desktop/Android/AndroidSDK
export PATH=$PATH:$ANDROID_HOME/bin
Set your android configuration. Just give these paths into the Qt Creator
JDK Location:
/Library/Java/JavaVirtualMachines/jdk1.8.0_45.jdk/Contents/Home
Android SDK Location:
/Users/graphics/Desktop/Android/AndroidSDK
Android NDK Location:
/Users/graphics/Desktop/Android/android-ndk-r10e
Ant executable:
/Users/graphics/Desktop/Android/apache-ant-1.9.5/bin/ant
Allow Automatically create kits for Android tool chains. To get your JDK location on Mac enter in terminal
/usr/libexec/java_home
Now create your virtual device as what you need and everything will be fine. No worries then. You can run your apps on both android emulator and iPhone simulator.
Notice: give path of AndroidSDK, Android NDK, Ant executable location according to yours.
One more thing that i did, previously installed Xcode 6.3

QT5 Creator "/usr/bin/g++" is used by qmake, but "/usr/bin/g++-9" is configured in the kit

In QT5 Creator, I changed the compiler version in the project kit, but it's throwing the above error now(note: 'g++' in this context refers to version 10, which QT5 isn't compatible with). I found some information on using terminal commands to change some stuff with qmake, but does anyone know how I can fix this?
Edit: To clarify, a kit different from the default kit is being used for this project(that's what I changed), and I'm migrating this project from QT4 to QT5. This is installed on Ubuntu, and there aren't multiple versions of QT on here(installed from Ubuntu repositories)

Can not set android clang compilers for Qt Android on Ubuntu

I installed Qt Android 5.15.2 on Ubuntu but there is problem with the compilers. This is what I have set:
And here is what QtCreator detects as compilers:
The first error is displayed here in the Qt version tab:
and also in the Kit tab I see this errors no matter which compilers I set from the available:
Why I got this errors? Can please someone that has android kit on Ubuntu already set, tell me which compilers is using and which paths are for the compilers?
I will add more information for the current compilers or kits if needed.
The problem is that you are trying to use a x86 compiler for Android. You need to install the specific compiler from the Android SDK/NDK. So the good news is that you might be only missing one step (step 2 below)
I tried to install from the Ubuntu stock packages. That was impossible to get to work.
I was able to set it up in the following way:
Download the Qt online installer. Login and DO NOT choose individual packages, install Qt for desktop and Qt for mobile (check the last 3 options). This will install Qt 6 + QtCreator
Run QtCreator after everything finishes (+1.2Gb download). Go to Tools>Options>Devices>Android. Check that Java SDK is ok. On the Android section, choose "Set up Android". Accept all licenses.
This is what you should see in the end:

Qt cannot load cocoa plugin

I'm trying to compile and run an application on a MacBook using Qt Creator. There are no issues compiling the project, but when I try and run it, it seems to be unable to load a plugin.
Could not load the Qt platform plugin "cocoa" in "" even though it was found.
The application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.
This error occurs both when trying to run the application from Qt Creator or via Finder. It seems to only happen when I use the CMake build system (no issues when using QMake), but my existing project that I need to deploy on MacOS uses CMake.
My steps to reproduce are:
Install a completely clean MacOS (no user data)
Install Xcode 11
Install CMake 3.15
Install Qt 5.13.1 MacOS package
Open QtCreator->New Project->Qt Quick Application - Scroll
Set build system to CMake (important)
Compile and notice error
I am using:
Qt 5.13.1
macOS Catalina 10.15
Apple Clang 11
I recognize that for final user deployment I will need to use the macqtdeploy tool to copy the Qt libraries to the executable folder, but I should be able to run my app from QtCreator without doing this? Especially as it works fine when using QMake.
So it ended up being some kind of name resolution thing where Qt Creator couldn't decide whether to use the debug or release versions of the framework. Supplying DYLD_IMAGE_SUFFIX=_debug fixed this (add this to the environment section under Kits).

qmake on a mac missing for qt-creator

I am working on Mac OS X at the moment, and wanted to start building apps using Qt Creator.
Unfortunately i can't build any applications as it gives me an error saying that qmake's path is not found or qmake is missing.
I tried using netbeans, which works perfectly with simple c/c++ programs, but for qt apps it then gives me the same error.
My version of Xcode 4 works perfectly and builds without any problems.
Any ideas?
Thanks :)
It is not enough to just download the Qt Creator, you need to download the complete sdk: http://qt.nokia.com/downloads (almost 1GiB)
My Macbook is no longer my primary computer. But, when it was, I found out through painful experiences that it was best to install software from MacPorts whenever what you wanted was available from http://www.macports.org/
Even more important, I also discovered that when software was not offered from MacPorts, it was invariably because that particular software did not install without some sort of tweaking on a Mac. Hence, since Macports does not currently offer Qt v5, and I had problems installing the qt-project.com Qt v5.2.1 SDK on my Macbook, I would advise to go with the MacPort for Qt v4.8.5 [qt4-mac] which includes qmake. Qt Creator is available as a separate MacPort [qt4-creator-mac].
Here is how I successfully installed Qt v4.8.5 [with qmake] and Qt Creator on my Macbook:
1) 'sudo port install qt4-mac'
2) 'sudo port install qt4-creator-mac'
3) I used Finder to run Qt Creator which was in the /Applications/MacPorts/Qt4 folder.
4) When I first ran Qt Creator, its Preferences dialog listed the auto-installed Desktop kit, but that kit had no Qt version, no qmake, and no debugger.
5) Manually added a second kit.
6) Configured kit's Qt version for /opt/local/bin/qmake, which is where qt4-mac installed qmake. This was enough for the kit to now discover Qt v4.8.5 which had been installed by qt4-mac.
7) Used kit's auto-detect feature to now discover the debugger.
8) Configured that kit to be the default kit.