I'm trying to setup Qt Creator for Android C++ development that uses non-Qt libraries. Testing with a simple Hello World, I have a problem in deploying the compiled program to AVD through Qt Creator. The deployment process always stuck with an error message of;
Install to device: emulator-5554 No platform plugin, neither
libqtforandroid.so or libqtforandroidGL.so, included in package.
Please include one. 06:34:06: The process
"/home/dev/Qt5.3.0/5.3/android_armv7/bin/androiddeployqt" exited with
code 12. Error while building/deploying project helloworld (kit:
Android for armeabi-v7a (GCC 4.8, Qt 5.3.0)) When executing step
'Deploy to Android device'
How should I go about it?
Thanks.
Related
I am having issues on deploying my android application to my phone. This error will pop up whenever i try to release my application (Error: Cannot find the androiddeploy Json file.). And i have checked my all my development kits and it seem that Qt had approved its settings. Thanks.
Cannot find the androiddeploy Json file.
Error while building/deploying project swipe (kit: Android for armeabi-v7a (Clang Qt 5.9.8 for Android ARMv7))
When executing step "Deploy to Android device"
I do not know if it helps, but I faced the exact same problem and I solved it by just unchecking the "Shadow build" checkbox under "Build settings" (ctrl+5). After that, everything worked.
Target device: Lenovo tabM10 FHD plus
Qt version: 5.15.2
Qt Creator version: 4.14.2
I am developing an app using QT for android on Window Platform. And I encountered a problem when I clicked 'Build' button for the android project. The error message showed that "
Cannot run target compiler 'C:\Android\android-ndk-r16b-windows-x86_64\android-ndk-r16b/toolchains/arm-linux-androideabi-4.9/prebuilt/windows-x86_64/bin/arm-linux-androideabi-g++'. Maybe you forgot to setup the environment?"
When I clicked 'Run' to the project, the error message showed that
"Cannot find the androiddeploy Json file.
Error while building/deploying project PhotoViewer (kit: Android for armeabi-v7a (GCC 4.9, Qt 5.9.3 for Android armv7))
When executing step "Deploy to Android device"".
I checked the correctness of my compiler location and they are correct. I am not sure what I did wrong for the config setting.
Did you correctly installed and configured all prerequisites for Android QT development ?
regarding Cannot run target compiler 'C:\Android\android-ndk-r16b-windows-x86_64\android-ndk-r16b/toolchains/arm-linux-androideabi-4.9/prebuilt/windows-x86_64/bin/arm-linux-androideabi-g++'
Check if Android NDK and the path in the error message does exist, QT is sure to work with ndk r10e.
if you are new to QT android development, you need to follow instructions here :
Installing the Prerequisites
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'm learning developing Android Application by Qt Creator (v4.1.0 Community). When I build my sample app, there's no issue but when I run it with Android x86 Kit (GCC 4.9, Qt 5.7.0), it's failed and I get this message from Compile Output Console (it still runs well when I run with Desktop Qt 5.7.0 MinGW 32 bit):
'C++' is not recognized as an internal or external command, operable
program or batch file.
'C++\Qt\build-AndroidAppSample-Android_for_x86_GCC_4_9_Qt_5_7_0-Debug\android-build\'
is not recognized as an internal or external command, operable program
or batch file. Error: Could not find or load main class
org.gradle.wrapper.GradleWrapperMain Building the android package
failed!
-- For more information, run this command with --verbose.
21:04:35: The process "C:\Qt\5.7\android_x86\bin\androiddeployqt.exe"
exited with code 14. Error while building/deploying project
AndroidAppSample (kit: Android for x86 (GCC 4.9, Qt 5.7.0)) When
executing step "Build Android APK"
Can anybody explain me what I do wrong or give some ideas to solve it. Thanks for any help.
Do you see your Android kit get detected automatically ? or was it added by you manually. I would suggest to try the thing I mentioned below and see if that helps.
On Projects, Build Android APK, change the Android build SDK to newer version as shown in the picture below:
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.