I am trying to run Android app in Qt-Creator .when i try to build it , it builds without any problems but when I hit run button , instead of asking where to run app it gives me this error :-
Cannot find the android build step.
Error while building/deploying project untitled (kit: Android for armeabi-v7a (GCC 4.9, Qt (android_armv7)))
When executing step "Deploy to Android device"
I am using Arch Linux . I had install Android SDK and NDK and OracleJDK 10.
I had connected my Karbon Titanium phone via USB to my laptop and enabled the USB DEBUGGING .
EDIT:-
Here are environment variables:-
% cat /etc/environment
#
# This file is parsed by pam_env module
#
# Syntax: simple "KEY=VAL" pairs on separate lines
#
JAVA_HOME=/usr/lib/jvm/default
JRE_HOME=/usr/lib/jvm/default-runtime
PATH=/home/jimbo/bin:/home/jimbo/.local/bin:/usr/local/bin:/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/sbin:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perl:/opt/cordova/bin:/opt/AndroidSDK/tools/bin
RUSTUP_HOME=/opt/Rust
CARGO_HOME=/opt/Rust/.cargo
ANDROID_HOME=/opt/AndroidSDK
ANDROID_NDK_HOME=/opt/AndroidNDK
PKG_CONFIG_PATH=/bin/pkg-config
Also I am using NDK 10e:-
you have to use Qt version 5.9.0 with sdk 26.1.1 and ndk version 10.4.0.
earlier version than 5.9.0 of qt will not work with sdk 26.1.1.
so you just need to update your Qt version to 5.9.0.
At Last, Use This Combination:
Jdk version : 1.8.0
SDK version : 26.1.1
NDK version : 10.4.0
Qt version : 5.9.0
it works for me. hope it will work for you. :)
It works for me.
Just delete Qt creator settings files and restart it:
Where does QtCreator save its settings?
On Windows 10, 8, Vista and 7, the files are located in
:\Users\\AppData\Roaming\QtProject and
:\Users\\AppData\Local\QtProject.
On Windows XP, the files are located in :\Documents and
Settings\\Application Data\QtProject and :\Documents
and Settings\\Local Settings\Application Data\QtProject.
https://bugreports.qt.io/browse/QTCREATORBUG-20088
A problem was solved when I re-created the QtC settings from scratch.
So, something wrong in QtC code, related to the settings update,
because, as can see from my screenshoots, the QtC reported that all
Android configuration is OK, but the build step was not created.
Related
I try to run the QT C++ usb debugger on an Android smartphone, altough there is a compilation error (on the screenshot #1). The downloaded version of QTCreator is 4.14.2 with Qt 6.0.3 MinGw 64-bit.
Ok, it's solved, you just need to delete the existing ".user" file from the project directory and choose your Android kit when you open up the project again.
Introduction
I'm trying to compile empty qt widget to android apk, just to test if my environment and configuration is correct. However it seems that for some reason compiler doesn't see some headers files.
Test Code (mainwindow.cpp)
#include "mainwindow.h"
#include "ui_mainwindow.h"
MainWindow::MainWindow(QWidget *parent) :
QMainWindow(parent),
ui(new Ui::MainWindow)
{
ui->setupUi(this);
}
MainWindow::~MainWindow()
{
delete ui;
}
It basically doesn't do anything, it's just compilation test.
My configuration
QT 5.8
OpenJDK 8.0.5120.1
Android SDK platform 27
Android NDK r16, 32bit and 64bit (tested both)
Windows 8.1 64 bit
QT Toolkits:
Android for armeabi-v7a (GCC 4.9, Qt 5.8.0)
Android for x86 (GCC 4.9,Qt 5.8.0)
The Question
Compilation of ever android apps, including this empty one mentioned above ends with:
stdlib.h: No such file or directory
Compiling desktop (*exe) apps works fine. I just can't configure correctly my environment for compilation android apk's. I tried with different versions of Android NDK, architecture, and with "QMAKE_CFLAGS_ISYSTEM=". Nothing works so far. What should I do to make it works?
UPDATE:
Thanks to #AlexCohn help I'm a bit closer to solve the issue. After changing NDK from r16 to r10e-x86 and SDK tools to 25.2.5, compilation goes a bit more, but not reach the end, as it brakes with the following command:
Building the android package failed!
-- For more information, run this command with --verbose.
Proces
"C:\Programming\Qt\5.8\android_armv7\bin\androiddeployqt.exe" exited
with code 14.
Error while building/deploying project and_test (kit:
Android for armeabi-v7a (GCC 4.9, Qt 5.8.0)) When executing step
"Build Android APK"
UPDATE 2:
Issue seems to be solved. One more change is needed as QT 5.9 seems to have compatibility issues with some versions of OpenJDK or Java SE. After a research I found that it is nesesery to install Java SE Development Kit 8. With this version, and all previous changes, finally the compilation ends successfully.
I already have made a project with Qt and I wanted to build on Android.
It worked fine, but since I use another Workstation, I can't deploy my application.
I get the following log output :
17:50:53: Could not start process "mingw32-make" INSTALL_ROOT="D:\Projects\Qt\Comp\build-proj-Android_for_armeabi_v7a_GCC_4_7_Qt_5_4_1-Release\android-build" install
Error while building/deploying project Proj (kit: Android for armeabi-v7a (GCC 4.7, Qt 5.4.1))
When executing step "Copy application data"
I checked my kits. All seems good.
My SDK and NDK works well, everything seems to work with Xamarin for example.
Regards,
Had the same issue, solution was to add the mingw32-make to the PATH variable,
missed this originally as i had already added it as an override for the Make build step and thought that would be enough.
I am trying to build an android APK in Qt Creator 3.0.1 . I have properly given the configured Android SDK, NDK, Ant, Java Jdk. In Build Android APK step under Build there is a option to specify Android Build SDK i.e target SDK. I am currenty using API 21 but it i am not getting an option to specify it over there.
Plz Help how can i do that.
First you should select Tools > Options > Android to add paths to the Android NDK and SDK :
Also select the Automatically create kits for Android tool chains option.
For configuring deployment settings you should go to Projects > Build Android APK > Details Since Qt 5.4 along with QtCreator 3.3.0. To create an APK package, select the Bundle Qt libraries in APK option :
You can also select Create Templates to create the manifest file to set application settings like icon, name, ...
In previous versions of Qt and Qt Creator you should go to Projects->Run->Deploy.
I recommend you to use the latest version of Qt and Qt Creator for Android development and deployment.
What helped me - switch off antivirus. Why see below:
I've got the same error and reinstallation didn`t help.
Runnning manually 'android.bat list targets' from cmd gives proper list of targets.
After digging into QtCreator code I found the reason - magic code for get list of targets in qt:
void AndroidConfig::updateAvailableSdkPlatforms() const
{
QProcess proc;
proc.setProcessEnvironment(androidToolEnvironment().toProcessEnvironment());
proc.start(androidToolPath().toString(), QStringList() << QLatin1String("list") << QLatin1String("target")); // list avaialbe AVDs
if (!proc.waitForFinished(10000)) {
proc.terminate();
return;
}
As you can see if 'android.bat list target' cmd will not finish for 10 seconds qtcreator will just terminate the process.
In my case it was 15 secs befor it finishes due to antivirus checks - so switching off antivirus could help in your case.
No need to restart QtCreator just open Android section in options again and all targets should be loaded.
I 'love' Qt - it is always like this with it.
I'm trying to learn something about multy hybrid app developing under visual studio 2013 using Apache Cordova. I've just created a new project and i'm trying to build it but when I try to build it for android I get 1 warning and 1 error.
warning:
Warning 1 The TypeScript Compiler was given no files for compilation, so it will skip compiling. C:\Program Files\MSBuild\Microsoft\VisualStudio\v12.0\TypeScript\Microsoft.TypeScript.targets 95 5 helloWorld
error:
Error 2 The command ""C:\Users\user01\AppData\Roaming\npm\node_modules\vs-mda\vs-cli" build --platform "Android" --configuration "Debug" --projectDir . --projectName "helloWorld" --language "en-US" --buildServerUrl "" --buildTarget "AndroidEmulator"" exited with code 1. C:\Users\user01\AppData\Roaming\npm\node_modules\vs-mda-targets\Microsoft.MDA.targets 99 5 helloWorld
I've googled those errors but I haven't sorted anything out. Do you know what is the problem?
The issue is because of Android target (latest version) is not available with Android SDK. Make sure the following in your system,
Go to Android installed folder (for me, C:\Users\username\AppData\Local\Android\android-sdk)
Go to tools folder and select "android.bat" Run as Administrator
Check whether the latest version of Android (ex: API 19) is installed or not
If it is not installed, select that API, click install by accepting License
If it is installed, close it and then Go to to root folder(ex: C:\Users\username\AppData\Local\Android\android-sdk)
Double click on the AVD Manager and create new AVD
Now I hope, you can able to build and run the application.