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

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

Related

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).

Qt - upload to MacOS AppStore from XCode

Is there anyone who can upload Qt project from XCode to MacOS AppStore ?
I'm deploying to iOS AppStore from XCode using -spec macx-xcode for qmake.
However, I have problem deploying to OSX AppStore using the same method, it seems that no Qt libraries are copied into .pkg/app file.
Application compiles fine, runs on Mac, passes validation but crashes during Apple Review (can't load QtPrintSupport).
When I export app from XCode I can't see Frameworks directory in Contents.
I can see Qt Framework in XCode in "General" tab under "Linked Frameworks and Libraries".
I have also tried to Embed Framework in "Build phases" or "General" tab but then there is an error with codesigning "failed with exit code 1" . It looks like it is trying to sign QtPrintSupport_debug
Exporting Qt project to XCode and then compiling and uploading to AppStore works fine for iOS, maybe it should work for macOS and I'm just making some error ?
Best Regards
Marek
Change dir to executable Path And run "macdeployqt" And finished now send to appstore

iOS kit not detected on Qt (macOS)

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).

How to build native apps for Gentoo 64bit (Linux kernel 2.6) using Qt SDK?

unfortunately I am new to Linux. I have made a virtual machine with Linux Mint 13 (32bit), installed Qt 5.0 with Qt Creator. I was given a task to create a simple FastCGI app for the server running Gentoo 64bit. This app must use Qt stuff.
The installation of 64bit Qt 5.0 through SSH failed due to the libSM.so.6 (shared object) absense.
How can I make this stuff work? Should I create another VM with Gentoo 64bit in order to train with Qt installation and not to mix 32bit and 64bit? My simple FastCGI app will work as a backend for a site.
You can develop everywhere you want. When you want to deploy, simply build the project on the Gentoo machine.
Note that you don't need to install Qt 5 manually on Gentoo. It is offered in the "qt" overlay. You add it with layman:
layman -a qt
Then you can emerge the Qt components you need by using slot 5. For example, to get Qt Core:
emerge -a qt-core:5
If you have never used Layman before, it's in the "app-portage/layman" package and you can find docs here:
http://layman.sourceforge.net

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.