I am getting started with developing an application for Android using Qt 5.8 and am running into issues running a basic application. When I run a basic application on an Android emulator, the application fails to load and a lot of errors are printed to the Qt console. Text file of errors
Images of Qt Creator, emulator, and errors
I followed tutorials online on getting the Android development environment set up, and as far as I know, I have the SDK, the NDK, Java, and ant all set up correctly.
From "create a project" in Qt, I selected the Qt Quick Control Application, and set the kit for Androidx86 and desktop. I basically kept the application as it came, but added a teal background and two text fields, but didn't change any code.
When I run the program for desktop, it works fine and opens as shown with clickable buttons and typeable text fields. But when I try to deploy the application on any emulated Android application on 7.1, the emulator boots properly but the app that displays is just this.
The error messages that show up in the Qt Designer are and here is a file dump of the whole list of errors that showed up from trying to run the app.
I am unable to figure out what these errors mean, as I installed Qt and the android files according to the documentation but still encountered these errors and was hoping someone would know what the issue was?
Probably related to the service change or similar (QtActivity etc.) Please check the following link. (Bug fixed and resolved) Fix version: 5.7.0 RC
https://bugreports.qt.io/browse/QTBUG-52373
Related
For the past week, I have been struggling to figure out how to run a Qt quick application with the Android kit. I have encountered numerous errors. Earlier, my OpenSSL settings on Android where not working, but I was able to fix it by downloading new OpenSSL files from online. After that, all the settings in Android settings have a checkmark to signify that they are working.
After that, I tried to run the program with the Android kit. However, unlike for you in the videos, Qt Creator did not auto detect an Android kit. In fact, I have uninstalled and reinstalled Qt numerous times to see if it would detect an Android kit. However, since this still did not work, I manually created my own kit. Here is a screenshot of what I filled out for it:
However, as you can see on the Qt version section, "Qt 5.15.0 for Android" is considered invalid. I have installed previous versions and the current version of Android numerous times on the Qt maintenance tool but all of them show as invalid. As a result, I changed the Qt version to "5.15.0 MinGW 32-bit".
When I tried to run the program, I got an error about not finding the gradle scripts. After researching, I found that since my Android SDK is past version 26.0.0, it is not downloaded with the SDK but should have been downloaded when I installed Qt. Since it clearly was not, and downgraded my version of Android SDK tools to one with the gradle scripts. There is still a green checkmark after it, so it was the correct SDK.
When I tried to run again, my Qt Creator crashes (meaning my laptop exits from Qt Creator immediately). As a result, I only try to build it. When I built it, I get the error that "Android deploy settings file not found, not building an APK. ". I tried researching the problem on the Qt forums and stack overflow but I could not find a valid solution. I continued to experiment more to get to the bottom of my problem.
Additionally, even before I run or do anything, when I start Qt, I get the following errors in general messages:
There are only 3 errors which seem to be repeated every couple of minutes. I have no idea what the some of the errors mean, but for the first one, I created a Android_NDK_ROOT environment variable, in the build settings for the project, Qt environment settings(tools->External->Configure->Environment->External Tools->Update Translations), and my Windows Environment variable settings and wrote "ANDROID_NDK_ROOT = ANDROID_NDK_ROOT=C:\Users\arjun\AppData\Local\Android\Sdk\ndk\21.3.6528147". However, even after all if this, my program still gave the same errors. Additionally, I could not figure out what the other two errors meant and choose to ignore them.
After this, I completely deleted my Qt Creator, and all the things I downloaded along with Qt. I then downloaded Qt. It basically did not change anything, except when I run it, I get a completely different error.
Here is the current state of errors and settings my Qt is in:
My Kits:
My Qt versions:
My manually created android kit:
Current compile output error:
Current Android settings:
Current general messages:
These are some file errors I have been getting randomly on Qt, usually when I try to run something. For the most part, I have been ignoring them and but they might be relevant to my problem. These come back to back, usually more at a time:
Issues I get when building:
In conclusion, my Qt is being difficult and I cannot seem to figure out how to run Android. I have followed all your instructions on the video as well as a lot more but I still cannot figure it out. Can you please help me fix the problem so that I can run Qt Applications on virtual android devices?
Thank You so much for your time and effort!
I create a big JavaFX application that works fine in desktop.
In Android, its size is about 20 Mbytes.
Now, for deploying it for Android, I have installed Gluon (JavaFxPorts).
With a small program (using the JavaFX transitions notions, timeline, ...), I have generated an .apk by calling the androidInstall gradle task. That works fine, except I cannot automatically install the .apk file in my phone. I do copy/paste from my desktop to my phone.
BUT, when I want to do the same process with my big application, at the end, my phone screen is already black.
Therefeore, even if this big application works fine on my desktop, it is necessary to debug it for Android on my desktop, too. But, I don't know how to?
What to do with apkDebug gradle task, ..?
gluon+gradle does not provide a kind of Android emulator that allows to finalize the debug on desktop for a smartphone with its specific features (size of screen, landscape orientation). Do you agree?
What is the additional tool that allows to do that?
Moreover,when the application is deployed in the smartphone, does it exist a tool that allows to finalize the debug on smartphone?
Thant you for your response
Note: I have installed Android SDK manager and its AVDM in Eclipse, but with the JavaFX use, it is impossible to use it, isn't it?
Debugging JavaFX projects on Android so far doesn't work on Android emulators.
Command Line
The usual approach is just log messages to the console (i.e. System.out.println() or Log.v()...), and then using adb logcat.
On command line, go to your Android sdk folder, enter into the platform-tools folder and run adb logcat -v threadtime. That will give you all the log messages from your device, so you'll need to find your FXActivity pid there and filter through it.
Another possibility is using Android's monitor under the tools folder, a GUI tool that will allow filtering the console messages.
Eclipse
There is an ADT plugin for Eclipse, that can be installed following this question. This will allow you displaying logCat and device windows among others. Basically this will offer the same options as the monitor tool.
However, this doesn't seem to work with recent versions of logcat.
Android Studio
You can import your gradle project with Android Studio and enable the Android framework, so you can open the Android Monitor, and easily filter the logcat messages, or switch to the monitor tab with live charts of memory, cpu, ...
Black screen
Typically a black screen means you have some exception going on, so you need to use any of the above mentioned logging methods to track it down, solve it and try again.
So I have just started my first app in which I have a button and when user clicks on it then it just print the message.
But when I build the app and when I run that app on android studio's console then after opening it crashes and then it stops working.
Meanwhile I have searched for the error and they suggested me to see logcat table or the text file in which I can easily see the errors but after it I am stuck because I have no idea that how can I solve such problem.
Please help me with it.
Not sure how capable you are with android and you haven't given us much info to work with.
could you post a brief description of the logcat from launching the apk to the apk actually crashing?
the logcat is gonna be the best option to diagnose it.
Are you using the android sdk and emulator?
Have you updated the resources and api's?
If you go into the resource list there should a online repo with a whole lot more SDK bits you might find help.
What api's and android version is your apk built from and is your emulator emulating the same android build?
Could be the apks GUI resolution or script related, have you checked through it all?
Microsoft visual studios has a very good debug system and trouble shoot but I'm not sure if android is compatible as I've only used wp8 on it. Worth finding out though.
I have just started internship in a company, they said i will be working on a android project using qt.I need to join them by next week, in meantime i thought of installing qt on my laptop which has Ubuntu 15.04(64-bit).
I downloaded Android SDK, Android NDK, Ant Executeable.
Here is my android settings in qt.
I created a sample app using New Project -> Qt quick Application,it pasted some sample code for hello world when i tried running it it said
could not find the executable please specify one qt
then i opened my project folder and specified a file having name same as my project name,fortunately it worked.
Now when i run the project it displays hello world but when i try to debug it either by attaching external device or through emulator it displays a pop-up which displays a string "Unknown error".
1.Have i specified the settings correctly?
2.how to get rid of this error and start debugging.
can i do debugging on my device in ubuntu.
I am just a beginner plz provide easily understandable answer.
I am new to Android development and Eclipse. I have been given an Android app and asked to make some simple changes to it. I can build the project and run it in the emulator, but I see some errors in the LogCat window in Eclipse.
I put aside the app I was given and wrote the Hello World app, following the Hello World tutorial on developer.android.com. With this simple app, I was surprised to see many errors and stack dumps in the LogCat window. I closed Eclipse and re-launched it. After waiting for Eclipse to finish initializing, LogCat was empty. Then I started the Hello World app by clicking the run button. After a while entries appeared in LogCat, including many errors.
With such a simple app, copied from the tutorial, I am guessing the errors arise from the development environment and/or virtual device rather than from the app itself, but I would like to be able to run apps without errors.
Is it a reasonable expectation to be able to run Android apps from Eclipse on an AVD without any errors? Or is it the state of the art that the development environment logs many errors and dumps stack traces even when everything is running "normally"?
If it is reasonable, I will pursue each error until I have cleaned up my environment and application. I would prefer this, as I would then know that if errors appear as I continue development, they arise from my application and must be fixed. On the other hand, I can't spend months developing Eclipse and the Android SDK. If I have to learn to live with logs full of error messages, I'll just ignore them unless something crashes.
Note that the Hello World application runs as expected - it appears to be working despite the errors.
I am running Eclipse Indigo SR2 and Android SDK ??? (I don't see a version number for the SDK - the installer is r18 and SDK Manager says there are no updates available) on Windows 7 Professional, 64bit. I am testing with Android 4.0.3.
Use either:
adb com.your.package:v
or in log cat on the side button (You may need to make this visible by pressing the button with two rectangles in it in log cat) press the plus button and then add an application filter