Application not working in release mode on Android
-
So I am experiencing a strange problem, my app (for Android) works fine if I build the application in Debug mode, however when I run the app on the device in release it doesn't work, more specifically the app runs (the UI written in QML works fine), but network requests (done using
QNetworkAccessManager
) don't work. Also in Release mode, in the "Application Output" tab there is no output and noqDebug()
event is shown.
EDIT: I have just checked and noticed that qDebug events (or anything else) are not shown in the Application Output even if I run the application in debug mode, however everything else works fine in debug mode (network requests are completed).EDIT2: below is my configuration
-
First thing to check is that you are using a late & most bug-free Qt version. And with Android, the second thing check is the version of NDK.
Related: When writing about problems, you should always tell the versions of everything - Qt, Android SDK & NDK, version of Android OS...
Without knowing the baseline - and first making sure it is correct - it makes no sense to try to figure out the possible problems and solutions. -
So I have investigated the issue a bit further. First I decided to completely remove and do a full reinstall of Qt on my system. Then I tried to run the application on an x86 emulator (one from the provided in Android Studio) and I have noticed that the application works fine there and the log messages are displayed correctly. So then I connected my phone, and tried to run
./adb logcat
to see if any log messages were displayed after launching the application from Qt Creator on the device and unfortunately no messages are displayed. I am a bit lost on what to do next. -
I have a got a new update on this issue, which I still can't solve. What I discovered is that this is somehow related to the device I am using. Indeed, I tried to run the application on Windows and saw the same issue. Then I tried to plug in a different Android device (Sony) and magically all the log messages were there. So I thought there was some problem with my device (LG G6 with Android 8.0) and I performed a hard reset on it (erasing all data and settings), but the issue still persists and log messages are not showing at all. Can anyone help me with this? I was able to see the log messages up until 2 weeks ago on the same device and now I suddenly can't.
-
Hi @daljit97,
if you create bugreports, please provide a link also here: QTCREATORBUG-21163. That way, others can follow the discussion later.
Thanks!
Regarding you problem:
I was able to see the log messages up until 2 weeks ago on the same device and now I suddenly can't.
Have you changed anything on your computer? Updated Qt, Qt Creator or Android NDK or SDK?
-
Thanks for the tip, I will keep that in mind.
@aha_1980 said in Application not working in release mode on Android:
Have you changed anything on your computer? Updated Qt, Qt Creator or Android NDK or SDK?
Well, yes I have reinstalled Qt on my Linux machine and installed Android Studio (for SDK and NDK). However, as I mentioned in the bug report I have tried to run the application from a fresh install of Qt on Windows and experienced the same issue.