Qt5.2.1 Android Windows7
I just install Qt5.2.1 for Android under Windows 7 ,and android sdk ,ndk,adt ,jdk are installed correctly. And the code is compiled OK. But somthing hanppend ...like this:
Error while building/deploying project QAndroid (kit: Android for armeabi-v7a (GCC 4.8, Qt 5.2.1))
There is no compatible device..
well then you don't have a compatible device connected and no suitable emulator is setup!?
hard to help if you don't tell us what devices you have connected or show us a screenshot from the device selector dialog maybe.
If you want to deploy and run your code on an Android device you have to provide that device; either as a real device connected to your Windows 7 machine via usb or as a virtual device running as an emulation on your Windows machine. Either way, the device has to have the CPU appropriate to the target that you specify when building your Qt app.
I guess that either you have no device available or if you do then it does not match the machine code that you selected to generate in Qt.
If you want to use a physical device then you need to set it up in 'developer mode' so the comms to Qt is available. Otherwise use the Android Virtual Device Manager to create a virtual device.
I confirm the problem. Tested on 2 different workstations.
Unistalled Qt 5.2.0 and installed Qt 5.2.1.
Updated from adt-bundle-windows-x86_64-20130917 to adt-bundle-windows-x86_64-20140321
from android-ndk-r9 to android-ndk-r9d
from apache-ant-1.9.2 to apache-ant-1.9.3
and when I press the "play/run" button a form appears listing all the virtual devices as incompatible. I didn't test with a real device....
I will try to open a bug.
I also got this message in "General message" panel
Project ERROR: You need to set the ANDROID_NDK_ROOT environment variable to point to your Android NDK.
Could not read qmake configuration file C:/Qt/Qt5.2.1/5.2.1/android_armv5/mkspecs/android-g++/qmake.conf.
yeah that is why you need to add the ANDROID_NDK_ROOT environment variable!? if you didn't do that no wonder nothing is working :D
I donìt think I need to set that env variable... I didn't set before and it worked...
I opened this bug report:
As you can read in the bug report, I set the SDK pointer to the old SDK and it is back working.
It may be a bug, but what does it hurt to set the env variable? i have it set and it works but it may be some other problem.
And the link isn't working here, "Issue Does Not Exist" :(
bug is 38064, there is a 1 that shouldn't be in the url, sorry.
Can you please show me your env setting ? where does it point to ? Anyway, if the variable was necessary why should we had to setup the dirs in the kits ?
I just set it to the NDK path, don't ask me why we have to do that but it works... Also adb sometimes crashes in my experience, so you should kill the task or restart your PC. That is an android SDK bug of course and has nothing to do with Qt.
bq. "The NDK is a toolset that allows you to implement parts of your app using native-code languages such as C and C++. For certain types of apps, this can be helpful so you can reuse existing code libraries written in these languages...
suggests the NDK is required because we want to use the Qt libraries and nothing will run without it.
Maybe one of your setups has it implicitly located on the search path so it doesn't complain that it can't find it but with the second setup the search path is slightly different and so it needs that explicit env var?
Ni Martyn, NDK is required and installed. There is a place in Qt Creator configuration where you set its directory path. The env variable should not be necessary.
It seems to be a problem of the new SDK (released on March 21):
You are right of course. I was thinking of the creator config, I dunno why I latched onto the env var - sorry!
I believe there is an incompatibility between the latest Android SDK and Qt 5.2.1. My suggestion : downgrade the Android SDK to version 22.3. I had similar building issued with Android (Qt 5.2.1 for MacOS) and solved them with the following procedure :
I am using the latest Android SDk 22.6.2 with Qt 5.2.1 on windows without any problems (android-ndk-r9d and apache-ant-1.9.3)?
The only problem I had forever is that I can't get x86 android builds to work, the app is just crashing.. but arm builds work fine!?
I think is not the version of Android SDK. When I switch to the API14(4.0.0) ,the problem still exists. So I try to connect my Android Phone to the computer ,I found that there is a compatible device listed,but these virtual devices created earlier were still incompatible. And there is another problem, I packed my program into *.apk and instll it to my phone, it seems to be stranger ,for the running result is not the same with the desktop program ,such as : I set the gui element(like QPushButton) to alignment with the top of the Widget, it is correct in desktop program ,but is not correct in Android program. Why is that?
can you provide some screenshots?
In most cases the alignment will be different because of the layout container and smaller spaces on mobile phones it might not fit on the screen or I don't know with any specifics.
My apps look exactly the same on all devices, so I have no idea.