Unsolved Cannot debug calqatr on Android
-
@Mitmischer said in Cannot debug calqatr on Android:
I'm using MinGW supplied with the Qt installation
I really doubt this as QtCreator uses the compiler provided by Android NDK.
-
@jsulm Hmm, looking at the logs you are absolutely right - so this has nothing to do with MinGW at least..
Note that I can actually debug Java stuff from Android Studio. I can also halt threads there. But that is not useful as I need the breakpoints in Qt Creator.
-
@Mitmischer Did you check your Android Kit - is debugger set up properly?
-
@jsulm The kits were auto-detected by Qt Creator - You can find the configuration below:
-
@Mitmischer Just to be sure: you're building in Debug mode?
-
@Mitmischer
just a couple of points to also check- have you enabled usb-debugging on your Android device?
- do you use an at least 4 wire cable -> make sure you can access the filesystem of the android device from your pc
- have you confirmed the trustworthiness of your pc on the device
- have you installed the
Google USB Driver
together with the other SDK - packages?
-
@jsulm Yes, I am building in debug mode. Also on the phone, USB debugging etc. is activated. I mean, I can build the Qt app on Desktop with debugging and I can build Android Java apps on the phone with debugging (using Android studio) - it's only the combination of Qt app and Android that I cannot debug.
-
@jsulm @J-Hilk USB-debugging is enabled and I can copy and read files from the PC to the phone. I installed a SAMSUNG USB driver, I hope that one is sufficient: I can control the phone by adb. What bothers me most is that I can attach to a running Qt app using Android Studio, so it looks to me that QtCreator is missing something or is not connecting properly. Sadly, debugging Qt Android apps with Android Studio is not useful..
-
Ok, I got news - maybe the connection itself is not at fault. I noted that I can pause the application from QtCreator. Pausing is successful as the app is unresponsive during the pause and it continues running afterwards. But in the pause, QtCreator gives me some disassembled code, no source code. Also, the stack trace consists of two lines of ??, that looks like missing debug information to me. What's more, if I try to jump to a line, I get the error message "[...] No symbol table loaded.". But I am definitely running a debug build as indicated in the configuration in the bottom left. The QML profiler is working absolutely fine. And still, if I activate "Wait for debugger" on the phone, I see the message "Failed to contact debugging port." on the phone. Something's fishy :|
-
@Mitmischer this is the exact problem we are having, all the same things we've tried as well. Did you find a solution? Thanks!
-
@tseg actually, seeing the date of this thread, I have a guess what may be the case here,
What version of Qtcreator are you using ? Haven‘t tried it with the newset, 4.7 one yet, but the android debugger kind of broke after 4.6, try it with a version prior\including to 4.6
-
Hi guys,
I'm a a bit late to the party, but I was having the exact same issue and just spent few hours working this out.Running Qt Creator 4.7.1
What you probably figured out is that gdb fails to load the debug symbols. First tricky thing, Qt Creator doesn't raise any error about it, you have to dig down the gdb logs:dINFERIOR STARTUP: BINARY NOT FOUND sReading debug information failed: s/home/flr03/Workspace/ethan-qt-epg-app/build-epg-ui-EPG_Android_for_armeabi_v7a_GCC_4_9_Qt_5_10_1_5_10_1_AndroidQt-Debug/app_process: No such file or directory.
So from this, I checked if the deploy step does its job properly, second surprise Qt Creator tries indeed to pull app_process but doesn't complain about anything, however the file is not pulled properly (others needed files seem to be pulled properly though).
As I can pull manually app_process from the terminal with adb, I work around the issue by adding a custom deploy step (Project/Run settings) doing that for me. Et voilà.Hope maybe this can help someone else being blocked with the same issue.