Qt wont run the app for Android - qt

I have been working with Qt Desktop for a year now, and I needed to set up the environment for Android. I have followed carefully the steps in Qt documentations, downloaded Android SDK, NDK, Ant and JDK 7. I included all the paths and created a kit for Android. I installed the latest Android APIs and System Images from SDK and also created a AVD Nexus running Android 5.1.
I created a project (when i create a Widget project, in the supported platforms at the right, Android is not shown, as in tutorial I have seen) and build and run it on Desktop - eveything Ok. When I try to run it on Android, a pop up shows, wanting the path of the executable, saying it can not find it. I don't know what to include here, cause in all the tutorials I have seen the AVD should start automatically (it is on, in the moment I try to run from Qt).
I don't what other settings to check, been seven hours now, trying to figure out the problem. I think the problem is in the Kit or in the Debugger, or in the Qt Version that can not detect the Android Kits or AVDs. Or it is just a silly thing that just need a path for the executable when running. These are all my system setting, please let me know if you need other info:
Qt Creator 3.3.2 (opensource)
Based on Qt 5.4.1 (MSVC 2010, 32 bit)
Android Kit:
Name: Android
File System Name: empty
Device Type: Android Device
Device: Run on Android(default for Android)
Sysroot: empty
Compiler: MinGw 4.9.1 32bit
Environment: No Changes to apply
Debugger: Android Debugger (I also tried to leave this Auto Detect, it was the same)
Android GDB server: Auto-Detect (I also tried including: C:\Qt_for_Android\android-ndk-r10e\prebuilt\android-arm\gdbserver, it was the same)
Qt Version: Qt 5.4.1 MinGW 32bit
Qt mkspec: empty
Qt Versions:
Auto-Detected: QtQt %{Qt:Version} MinGW 32bit
no Manual
Compilers:
MinGW 4.9.1 32 bit
and several others for Android GCC (arm-4.8, mips, x86), but when I try to include them into the Android Kit, the Kit is not Available, I can choose only MinGW, which seems the most probable problem to me.
Debuggers:
Auto-Detect:
GNU gdb 7.8 for MinGW
CDB at ...
Manual"
Android with path : C:\Qt_for_Android\android-ndk-r10e\toolchains\arm-linux-androideabi-4.9\prebuilt\windows\bin\arm-linux-androideabi-gdb.exe
I really don't know what the problem is, and I need to start soon.

Related

Cannot step into Qt source

I create a Qt project,build the project with msvc2017-32bit kit, and debug the project in Qt Creator. The problem is I can not step into the Qt functions. I can stop at break-points in my own source code, but cannot stop at break-points in files in Qt src directory. When I step into a Qt function, a message Stopped: "end-stepping-range" appears by the debugging buttons. Why could this happen?
According to #user13088490's suggestion, I installed the debugger tools for windows in windows 10 SDK, but the problem persists.
Follow the instructions from Qt here.
For Mac, the instructions are:
In Projects->Build&Run->Run->Run Settings->Run, select "Use debug version of frameworks".
There are different instructions for Windows, but I have not tried it yet.
You probably also need to have QT sources installed.
Go to the MaintenanceTool and check if Qt Creator 4.15.2 CDB Debugger Support and Debugging Tools for Windows has been selected.
I run Qt on Windows, although a different compiler than you, and you can set the debug target paths by going to Tools->Options->Debugger. From here you can click a button Add Qt sources.... Below is an image of my setup and this works for me.

Qt Cross Compiling on Mac for EGLFS on Raspberry Pi

I'm trying to create a Qt application that will run embedded on a Raspberry Pi 3. I followed this guide for cross-compiling and was able to run the example qopenglwidget on the Pi correctly. Now my problem is that I would like to build on my Macbook Pro in Qt Creator, but I have no idea how to now deploy to the device. All the guides I've seen online haven't explained what's actually going on and I have no idea how to build a cross compiler on my Mac. Could anyone point me in the right direction about how to do this?
So you have already compiled an example on your mac that runs on your raspberry pi?
This means you already have a cross compiler.
The guide you linked got a prebuild toolchain from https://github.com/raspberrypi/tools
But I think those are only for ubuntu.
When building Qt you need to specify the toolchain in the configure line:
-device-option CROSS_COMPILE=~/raspi/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian-x64/bin/arm-linux-gnueabihf- \
This is the path to the cross compiler you compile Qt with.
Did this work for you or did you modify this line?
If you want to build a cross compiler yourself you can follow this guide, although I wasn't able to compile Qt with this compiler.
If you have compiled Qt and the examples work on your Pi, you can add a new kit in Qt Creator on your Mac:
Open Qt-Creator -> Preferences:
Under Devices, add a new Generic Linux Device and follow the assistant
Add a new kit, choose a Generic Linux Device as well and specify the device you just added, your compiler you used to build Qt, the debugger if you have built one with you compiler and the Qt Version you compiled.
You should be able to build your project with this kit and it will deploy to your device
Tell us if you were successful.

How to debug/step into QT SDK sources from my project

I want to debug, set break points etc in QT SDK sources,
I have QT5.5.0 built with symbols and symbols are picked up, at lest GDB says so.
But I still cannot debug into for Example QGuiApplication, well I don't really care about QGuiApplication but I want to be able to set break point anywhere in QT Sources and stop there when my code get there.
I do have QT 5.5.0 project opened alongside with my project, but setting break point in QT5.5.0 does not have any effect, also stepping into any QT SDK code simply does nothing, it just stays where it was stopped by breakpoint in my project.
So question is how can I place breakpoints in QT SDK code anywhere I want and when I debug my project I will be able to stop in QT code. And how can I step into QT SDK code.
Ubuntu 14.04, QT 5.5.0, Creator 3.6.0, QNX ( ARM platform ) but it is irrelevant.
Don't install any QT binary (qtcore/qtgui),
build from source and
intall them with debug symbols, should be around 200~300M each library.
Make sure your example code is loading the debug version of qt files.

QT Creator, compiling and deploying a c or c++ to a remote device (BeagleBone or R pi)

I'm trying since days to write and develop programs on my host pc (Ubuntu 64bit) using qt-creator for my beaglebone and raspberry pi devices.
I looked for 'qt-creator cross compile beagle, raspberry etc...' and it leads me to hundred of links and tutorial on how to compile qt-creator for my target plattform. But seriously, that not my idea. All what I want is to simply use my pc for developing my programs and lately deploy them to the remote device.
So first of all a noob question: Is something wrong with my idea? Should I really compile the source of qt for beaglebone or raspberry on my pc for writing programs which lately should be run on that devices????
I will not compile qt-creator again for another plattform, so I don't know how to find the right way. A lot of informations on internet are misleading.
So after many hours spend look for the right information I come up with the following procedure:
first I installed a arm-gnu toolchain on my 64bit Ubuntu.
sudo apt-get install build-essential libc6-armhf-cross libc6-dev-armhf-cross binutils-arm-linux-gnueabihf linux-libc-dev-armhf-cross libstdc++6-armhf-cross gcc-4.8-arm-linux-gnueabihf g++-4.8-arm-linux-gnueabihf
then I installed qt-creator from the repository on my Ubuntu:
sudo apt-get install qtcreator
I tried to configure to use qt for compiling my projects using the toolchain for arm (see following pictures)
and here:
but it seems that qt-creator doesn't recognize the new kit when I start a new project:
Now: I m really confused, I could think that the problem is related to qt, but I m not sure, whether the way of thinking, that I can compile on ubuntu 64bit and then run my application on the remote device is right or not.
For this reason it would be nice if you can answer the question above.
UPDATE: What happen if I add a QT-Version in my Kit???
It happens that the gnueabi compiler conflicts with that options and the following problem arises:
I would like to say again that I don't need to use qt-library or something like that on my remote device. I need just to use the qt-IDE as IDE for my projects (mainly c or c++ plain projects)
You need a complete toolchain
A toolchain is just a name for a group of things:
Compiler for the target platform (or cross compiler in your case)
Sysroot: An image of the filesystem in the target platform
A cross compiling qmake
QtCreator and the kit
You are lacking a cross compiling qmake. Please see my answer at this other post.
Furthermore, you need a toolchain for the Pi, and another toolchain for the Beagle.
It looks like before the update in the question, you didn't even have a valid kit, so there was nothing the IDE could do. You need to create a kit, and set Qt Version to None - because whatever Qt version you have installed is not for the ARM target. So, as long as it'll be none, it should work then, assuming that you have installed a full ARM toolchain for the target, including the Linux-specific bits - since you're not building a bare-bones application, but an application that will run on Linux.
When creating a new project, make sure to select Non-Qt Project, either C or C++, and choose the CMake build system (not qmake or qbs).
To test this out, start with creating a kit for your host platform, without selecting a Qt version (set it to None), and make sure you can create a simple C project and build it (choose proper compilers etc). Once you have done that, you should have an idea how to proceed with building for your ARM Linux targets. It really shouldn't be problematic at all (it all "just works" in my experience), so you probably didn't install something major (related to the target toolchain, nothing to do with Qt nor Qt Creator).
In Derek Molloy's tutorial for the Beaglebone on this subject, he mentions at around minute 18 that installing QT directly through the command sudo apt-get install qtcreator, won't install all the features of the QT app.
Try downloading QT directly from Qt site.

Qt sdk1.1 == 1.5GB. Why So Huge?

I've been searching for this info with no luck. I'm using SDK1 with 4.7.0. Works fine but has some issues with Postres so I need to update. The thing is...
I go to download RC SDK1.1 and I see windows version is 1.5GB!!
The Linux version is about 700MB.
Why is Win version more than double?
SDK1 was about 320MB for windows and 400MB+ for Linux.
So Windows version was relatively smaller than Linux version considerably and sdk1 was drastically smaller than sdk1.1. I hear that 1.5GB unpacks to 5GB.
Of course, if you download the framework and creator separately than it is normal size (roughly equivalent to SDK1). This just adds to confusion. Isn't the SDK == Framework + creator ?
Something is wrong here... Any ideas what is going on? Should I wait till full release version?
I think thats because only Windows supports development for Symbian platform using Symbian SDK that can be installed (other platforms use remote compiler). Nokia with Qt SDK 1.1 announcement mentioned that they refactored Symbian toolchains so now you can use Symbian ^ 1 and Symbian ^ 3 native APIs. I think that what made the installer so huge. On the web site I noticed they have web installer, so I'd recommend to download the web installer which is just 15Mb and I suppose it should be a wizzard page that allows you to select which parts to install. Just don't install Symbian native SDK or anything else you don't need.
Hope that helps

Resources