Important: Please read the Qt Code of Conduct -

Android debugger does not work

  • I am trying to debug Android application on fresh installation. SDK and NDK are present and added to the PATH, Qt Creator knows about them.

    But when I select Android armv7 kit and press "Debug" for simple Hello World application it just says:

    Debugging starts
    Debugging has finished

    Debugger log is the following, also nothing particularly useful here:

    Starting debugger "GdbEngine" for ABI "arm-linux-android-elf-32bit"...
    dStart parameters: 'org.qtproject.example.debug_test' mode: 6
    dABI: arm-linux-android-elf-32bit
    dLanguages: c++ 
    dExecutable: /home/alexey/work_objscanning/src/misc/test/debug_test/build-debug_test-Android_for_armeabi_v7a_GCC_4_9_Qt_5_5_0-Release/app_process 
    dDebugger: /home/alexey/work_objscanning/tools/android-ndk-r10d/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/arm-linux-androideabi-gdb
    dQML server:
    dRemote: :5039
    dDebug Source Location: 
    dDebugger settings: 
    dBreakOnAbort: true  (default: false)  ***
    dShowQmlObjectTree: true  (default: true)
    dNoPluginBreakpoints: false  (default: false)
    dSelectedPluginBreakpointsPattern: .*  (default: .*)
    dSelectedPluginBreakpoints: false  (default: false)
    dAdjustBreakpointLocations: true  (default: true)
    dBreakOnWarning: false  (default: false)
    dBreakOnFatal: true  (default: false)  ***
    dBreakOnThrow: false  (default: false)
    dBreakOnCatch: false  (default: false)
    dWatchdogTimeout: 120  (default: 20)  ***
    dAutoEnrichParameters: true  (default: true)
    dGdbStartupCommands:   (default: )
    dGdbPostAttachCommands:   (default: )
    dWarnOnReleaseBuilds: true  (default: true)
    dMultiInferior: true  (default: false)  ***
    dUseDynamicType: true  (default: true)
    dTargetAsync: false  (default: false)
    dCDB_Console: false  (default: false)
    dBreakpointCorrection: true  (default: true)
    dBreakEvent:   (default: )
    dBreakOnCrtDbgReport: false  (default: false)
    dLoadGdbDumpers2: true  (default: false)  ***
    dAttemptQuickStart: true  (default: false)  ***
    dIgnoreFirstChanceAccessViolation: false  (default: false)
    dLoadGdbInit: true  (default: true)
    dDisplayStringLimit: 110  (default: 100)  ***
    dListSourceFiles: false  (default: false)
    dAutoDerefPointers: true  (default: true)
    dMaximalStringLength: 10000  (default: 10000)
    dAllPluginBreakpoints: true  (default: true)
    dSkipKnownFrames: false  (default: false)
    dEnableReverseDebugging: false  (default: false)
    dMaximalStackDepth: 44  (default: 20)  ***
    dIntelFlavor: false  (default: false)
    dIdentifyDebugInfoPackages: true  (default: false)  ***
    dShowQtNamespace: true  (default: true)
    dSortStructMembers: true  (default: true)
    dShowStandardNamespace: true  (default: true)
    dCloseBuffersOnExit: true  (default: false)  ***
    dCloseMemoryBuffersOnExit: true  (default: true)
    dRaiseOnInterrupt: true  (default: true)
    dStationaryEditorWhileStepping: false  (default: false)
    dSwitchModeOnExit: false  (default: false)
    dBreakpointsFullPath: true  (default: false)  ***
    dFontSizeFollowsEditor: false  (default: false)
    dUseMessageBoxForSignals: true  (default: true)
    dUseAlternatingRowColours: false  (default: false)
    dLogTimeStamps: false  (default: false)
    dVerboseLog: false  (default: false)
    dAutoQuit: false  (default: false)
    dAlwaysAdjustColumnWidths: true  (default: true)
    dExtraDumperFile:   (default: )
    dUseAddressInStackView: false  (default: false)
    dSymbolPaths:   (default: )
    dSourcePaths:   (default: )
    dGdbCustomDumperCommands:   (default: )
    dAdditionalArguments:   (default: )
    dShowThreadNames: true  (default: false)  ***
    dUseToolTips: true  (default: true)
    dUseDebuggingHelper: true  (default: true)
    dUseCodeModel: true  (default: true)
    dUseToolTipsInBreakpointsView: false  (default: true)  ***
    dUseAddressInBreakpointsView: false  (default: false)
    dUseToolTipsInLocalsView: false  (default: false)
    dUseToolTipsInBreakpointsView: false  (default: false)
    dQmlInspector.ShowAppOnTop: false  (default: false)
    dState changed from DebuggerNotReady(0) to EngineSetupRequested(1) [master]
    dState changed from EngineSetupRequested(1) to InferiorExitOk(16) [master]
    dState changed from InferiorExitOk(16) to InferiorShutdownOk(19) [master]
    dState changed from InferiorShutdownOk(19) to EngineShutdownRequested(20) [master]
    dState changed from EngineShutdownRequested(20) to EngineShutdownOk(22) [master]
    dState changed from EngineShutdownOk(22) to DebuggerFinished(23) [master]
    sDebugger finished.

    How do I diagnose this?

  • Same here, on a OS X host. The same installation worked fine until some day ago, the only thing that maybe I did was to update the android SDK... I tried (almost) everything, also a clean reinstall of Qt 5.4.2 but without success.... any hints anyone?

  • In my case, the culprit seems to be something the latest Android SDK tools, I did a restore of an old version (one month) of the sdk folder with Time Machine, and now is working again, without changing anything in my project and/or the Qt installation.

  • I have the same issue on Windows and Linux, Android SDK API 19, can compile and run on android, but cannot debug. Anyone knows how to solve this?

  • @sharethl I have a similar issue, that no one has been able to answer. No problem debugging as a desktop application, but the mobile debugger does not work at all on android. I can run apps as well. I have tried three different NDK's 9, and latest two version of 10, also tried recent SDK, and one before it. I am guessing there is a major bug, as I have tried for 2 days to get something to work on a very basic application.

  • I lost several days to understand the problem that is simply the last SDK ( no NDK ) , try using an older SDK without update, a new Qt5.5.0 version and recompile your project.

  • @GGenny what version you used?


  • @GGenny What version of the SDK are you using? I did something similar and went back to build tools 23.0 (current is 24.0) and turned off updates. but I am still getting no love from the debugger.

  • @john3000 I have tried out, with Android SDK Platform-tools rev 22, I can debug.

  • @sharethl Did you have to go back to "Platform SDK Tools" rev 22.x.x or the "Andoird SDK Platform Tools" rev 22 in Android SDK Manager? I am currently trying rev 22.6.2 of the SDK (the name of the tar.gz file) . I'll let you all know it goes, but I would rather be using the newest version that work, as this version doesn't support lollipop levels of API, android 4.4.2 is the highest level. Screen Grab of android sdk manager

  • @sharethl Thanks for sharing. I will definitely lodge a bug against this over for the newest Qt Creator. I wonder if I just missed somewhere in the notes that it wouldn't work with anything newer than 22.6 build of the SDK. It will certainly build and run just fine, it just won't debug. Thanks for your help and that of @sharethl . Now I just have to figure out why I can step through the init code but as soon as I enter the window app the gdbserver shuts down because of illegal memory access. Maybe I have to build the Qt .so files from scratch with debug symbols. Not sure though.

  • @john3000 I found that I had to also use the 32 bit version of the NDK to work as well.

  • @john3000 Here is the list I have. Hate cannot upload image on here.

    • Android SDK Tool Rev24.3.3
    • SDK Platform-tools Rev 22
    • SDK Build-tools Rev 22.0.1
    • SDK Build tools Rev 20
    • Adnroid API 22 and 19, SDK Platform
    • Extras: Android support library Rev 22.2.1

    I have two ubuntu PCs, 2nd PC with SDK Platform tools 23 cannot debug, once I copied the SDK mentioned above to 2nd PC, debug working.
    I have Linux-Mint , 64 bits, android-ndk-r10e.

  • here is the link with instruction how to downgrade platform-tools, I did downgrade to rev 22 and debugger started to work.

  • Hello,
    after your downgrade did you have any problems with gdb?
    Because if i try to step into, after a little time I receive the message:
    "The gdb process has not responded to a command within 40 second(s).".
    As it is really slow....

    Do you think that I have to downgrade/upgrade it?
    I'm on Windows 10 (...tried on Ubuntu, it works perfectly)

    Thank you.

  • @sharethl Thanks. I also got stuff working I just haven't checked back in a while. I think your list works just fine. I am using ubuntu 14.04.

  • Qt Champions 2020

    Please watch for and related bugs..

  • @aidoru Windown10 and Ubuntu both working for me.

Log in to reply