Unable to debug Android App (Windows + Qt Creator 12 + LLDB)
-
AFTER disabling
- wait for debugger in Android Developer Settings (on mobile)
AND - after REMOVING the debugged application from the list of debugged applications ON ANDROID DEVICE
we are able to get have breakpoints working WAY SOONER (!!!)
now that i strange on the grounds of its own, is it not.....but STILL unable to have breakpoints at main() stage working at all.
Yet again we are talking about QT Creator 12 + GDB + Qt 5.15.16 (LTS)
so the pressing issues are
- get to know how to break as soon as in main() - normal thing to be expected
- what the heck are sig-faults in Qt related code?
- wait for debugger in Android Developer Settings (on mobile)
-
so seems like nobody (as usually) can assist around here even in questions regarding basic debugging.... this community is such a shame...
-
@CodesInChaoss Maybe try to do it on Linux and it could be easier. The executable is same.
-
@CodesInChaoss said in Unable to debug Android App (Windows + Qt Creator 12 + LLDB):
so seems like nobody (as usually) can assist around here even in questions regarding basic debugging.... this community is such a shame
A lot of lazy devs here ;-)
I'm especially interested in Qt because of its cross-platform ability. I do 90% of my android development in a native compile, with a window on my desktop. Have had maybe once or twice the wish to have a debugger for my remote Android device, but never found it important enough to install the tools for that. Qt Android tools are too freaking huge.
So, I'm lazy and debug on the native app on my desktop. Then do testing on the device, which rarely gives me issues I could not see on the desktop.
Not saying that what you want is wrong or anything like that. If QtCreator tells you that breakpoints should work, then they should work. And a paying customer should be able to demand attention from the Qt company.
I'm not a paying customer, no support for me.
Plenty of problems with the new Qt company of the last years, gerrit sucks. Jira even more so. As an open source programmer I have zero incentive to report bugs for the LTS releases since I'd wait at minimum a full year for a bugfix. And the quality is just really quite sad for Android. But it still is better than most alternatives I've tried. So here we are :-) -
the funniest thing of all is we've got an immense code base already so if we do not solve the issues above (LLDB - unable to debug at all) and GDB crashing all the time with all the other crazy shit going on - we would be FORCED to pay the above in HOPES they manage to give us some helpful hand.
Go figure.
-
we're just too afraid they gonna say hey see - IT WORKS WITH A
HELLO WORLD
-
it all feels like there are some race condition issues or whatever...
it some times (on 3% of occasions) works PERFECTLY.
AFTER WE"VE INTRODUCE CUSTOM OVERRIDED TO SIG_FAULTS THROWN UPON US from QT.
as of now , as it is on current setup.
while on 97% of occasions it's UNUSABLE.
And that's a thing to worry about.
Creator dying every now and then... same for GDB... LLDB unusable.. breakpoints working on some occasions.. skipped other times...debugger kicking in late.....
it doesn't take a genius to notice that it's that's the case on QT Creator 12 with QT 5.15.16 on default settings and NDK/SDK installed by Creator itself, something is not right
-
Go ahead and try setup QT Creator 12 and Android SDK on fresh Windows 11
Kits won't get created (..) openssl won't get downloaded. it's all messed up
-
one of many examples on fresh windows install through online installer Commercial edition
-
-
@CodesInChaoss did you click apply button after resetting.
-
@JoeCFD yes as of now, we've deployed like 3 VMs already , we're diving into crazy things such as updating maveen, gradle, checking any binary dependancies, diving deep into the internals of GDB..... it does NOT work.
take a look at what official Android site says about debugging with GDB
-
Let me emphasize - all was fine with QT 5.15.12 and OLD Creator 10 community edition over GDB.
-
All the time while playing around with settings, while editing and saving QT Creator 12 would deploy new kits..... forgetting some settings... like the yellow triangle next to each is about missing compiler settings.. and of course.. it was set
-
@CodesInChaoss Clone of Android Qt 5.15.16 Clang Multi-Abi
These are my settings.
I expected this upgrade to QT 5.15.16 and QT Creator 12 to take an hour or two, not many days without results. Targeting Android API 31
The pro file:```
TEMPLATE = app
CONFIG += c++17
app = tokenapp
QMAKE_BUNDLE=tokenapp
QMAKE_PROVISIONING_PROFILE="tokenTestProfile"
QMAKE_TARGET_BUNDLE_PREFIX = org.gridnetANDROID_VERSION_NAME = "6"
ANDROID_VERSION_CODE = 6
DEFINES += IS_QT_BUILD
android {
ANDROID_MIN_SDK_VERSION = 26
ANDROID_TARGET_SDK_VERSION = 31
}QMAKE_CXXFLAGS += -std=c++17
QMAKE_LFLAGS += -std=c++17
CONFIG += qzxing_multimedia
enable_decoder_1d_barcodes
enable_decoder_qr_code
enable_decoder_data_matrix
enable_decoder_aztec
enable_decoder_pdf17CONFIG(debug, debug|release) {
CONFIG+=qml_debug
} else {
DEFINES += QT_NO_DEBUG
DEFINES += QT_NO_DEBUG_OUTPUT}
QT +=core gui
QT += multimedia multimediawidgets
QT += quickwidgets
QT += gui-private
QT += network
#QTPLUGIN += qtaudio_coreaudio
HEADERS += conversation.h
DataConcatenator.h
EEndPoint.h
GridScriptCompiler.h
IManager.h
InstructionSet.h
KeyEater.h
NetMsg.h
NetTask.h
NetworkDevice.h
OperationResult.h
Receipt.h
SafeArea.h
ScriptEngine.h
SensorState.h
SessionDescription.h
ThreadPool.h
TokenPool.h
TokenPoolBank.h
TransmissionToken.h
TrieLeafNode.h
TrieNode.h
UDT/api.h
UDT/buffer.h
UDT/cache.h
UDT/mD5U.h
UDT/ccc.h
UDT/channel.h
UDT/common.h
UDT/core.h
UDT/epoll.h
UDT/list.h
UDT/packet.h
UDT/queue.h
UDT/udt.h
UDT/window.h
VMMetaGenerator.h
VMMetaEntry.h
VMMetaGenerator.h
VMMetaParser.h
VMMetaSection.h
VMProcessor.h
application.h
base64/include/chromiumbase64.h
base64/include/fastavx512bwbase64.h
base64/include/fastavxbase64.h
base64/include/klompavxbase64.h
base64/include/linuxbase64.h
base64/include/quicktimebase64.h
base64/include/scalarbase64.h
botan_all.h
cconfirmationbox.h
cglobalsecsettings.h
cidentitybox.h
cnetworkfactory.h
conversationState.h
cqrintentresponse.h
hexi.h
hexiPhrase.h
miniaudio.h
native.h
pkcs11.h
pkcs11f.h
pkcs11t.h
tests.h
transaction.h
transferbox.h
transferboxcppSOURCES += main.cpp
EEndPoint.cpp
GridScriptCompiler.cpp
KeyEater.cpp
NetMsg.cpp
NetTask.cpp
NetworkDevice.cpp
OperationResult.cpp
Receipt.cpp
SensorState.cpp
SessionDescription.cpp
TokenPool.cpp
TokenPoolBank.cpp
TransmissionToken.cpp
TrieLeafNode.cpp
TrieNode.cpp
UDT/api.cpp
UDT/buffer.cpp
UDT/cache.cpp
UDT/ccc.cpp
UDT/channel.cpp
UDT/common.cpp
UDT/core.cpp
UDT/epoll.cpp
UDT/list.cpp
UDT/mD5U.cpp
UDT/packet.cpp
UDT/queue.cpp
UDT/window.cpp
VMMetaEntry.cpp
VMMetaGenerator.cpp
VMMetaParser.cpp
VMMetaSection.cpp
VMProcessor.cpp
application.cpp
cconfirmationbox.cpp
cglobalsecsettings.cpp
cidentitybox.cpp
cnetworkfactory.cpp
conversation.cpp
conversationState.cpp
cqrintentresponse.cpp
hexi.cpp
hexiPhrase.cpp
native.cpp
scriptengine.cpp
tests.cpp
transaction.cpp
transferbox.cpp#the following source files are platform-specific
android {
SOURCES += miniaudio.c}
else:ios {
SOURCES += miniaudio.m}
RESOURCES += qml.qrc
Additional import path used to resolve QML modules in Qt Creator's code model
//QML2_IMPORT_PATH += xzing/src/
include(./xzing/src/QZXing-components.pri)Default rules for deployment.
include(deployment.pri)
android {
LIBS += -lOpenSLES QT += androidextras QT += widgets QT += quickcontrols2 DISTFILES += \ android/gradle/wrapper/gradle-wrapper.jar \ android/gradlew \ android/res/values/libs.xml \ android/build.gradle \ android/gradle/wrapper/gradle-wrapper.properties \ android/gradlew.bat \ android/gradle/wrapper/gradle-wrapper.jar \ android/gradlew \ android/res/values/libs.xml \ android/res/mipmap-anydpi-v26/icon.xml \ android/res/mipmap-anydpi-v26/icon_round.xml \ android/res/mipmap-xxxhdpi/icon.png \ android/res/mipmap-xxxhdpi/launcher_foreground.png \ android/build.gradle \ android/gradle/wrapper/gradle-wrapper.properties \ android/gradlew.bat
LIBS += -L$$PWD/jniLibs/$$QT_ARCH/ -lbotan-2
ANDROID_PACKAGE_SOURCE_DIR = $$PWD/android
PRE_TARGETDEPS += $$PWD/jniLibs/$$QT_ARCH/libbotan-2.a}
else:ios {
QMAKE_INFO_PLIST=Info.plist
LIBS += $$PWD/jniLibs/$$QT_ARCH/libbotan-2.a
LIBS += -framework CoreFoundation
LIBS += -framework CoreAudio}
ios {
QMAKE_ASSET_CATALOGS = $$PWD/iOS/Images.xcassets
QMAKE_ASSET_CATALOGS_APP_ICON = "AppIcon"
deployment.files = $$files($$PWD/iOS/LaunchImages/*.gif)
deployment.path =QMAKE_BUNDLE_DATA += deployment app_launch_screen.files = $$files($$PWD/iOS/MyLaunchScreen.storyboard) QMAKE_BUNDLE_DATA += app_launch_screen
}
Q_ENABLE_BITCODE.name = ENABLE_BITCODE
Q_ENABLE_BITCODE.value = NO
QMAKE_MAC_XCODE_SETTINGS += Q_ENABLE_BITCODEDISTFILES +=
../Whitepapers/SMART GRID/logoBoxself.png
android/AndroidManifest.xml
android/AndroidManifest_copy.xml
android/gradlew.bat
android/gradlew.bat
images/abort.png
images/animatedqr.gif
images/confirm.png
images/confirmed.png
images/eyes.gif
images/logoboxself.png
images/overlay.gif
images/scannedok.png
images/scannedwrong.png
images/settings.png
images/ergLimit.png
images/tx.png
images/ergPrice.png
images/icons.png
images/Recipient.png
voices/welcome.mp3
jniLibs/$$QT_ARCH/botan
jniLibs/$$QT_ARCH/libbotan-2.a
jniLibs/$$QT_ARCH/libbotan-2.soOTHER_FILES += iOS/*.storyboard
INCLUDEPATH += $$PWD/jniLibs/$$QT_ARCH
DEPENDPATH += $$PWD/jniLibs/$$QT_ARCHANDROID_EXTRA_LIBS += $$PWD/jniLibs/$$QT_ARCH/libbotan-2.so
Default rules for deployment.
qnx: target.path = /tmp/$${TARGET}/bin
else: unix:!android: target.path = /opt/$${TARGET}/bin
!isEmpty(target.path): INSTALLS += targetANDROID_ABIS += arm64-v8a
armeabi-v7a -
and the build.gradle file:```
buildscript {
repositories {
google()
mavenCentral() // For Kotlin and many other dependencies
}dependencies {
classpath 'com.android.tools.build:gradle:7.0.4'
}
}repositories {
google()
jcenter()
}apply plugin: 'com.android.application'
dependencies {
implementation fileTree(dir: 'libs', include: ['.jar', '.aar'])
implementation 'com.android.support:appcompat-v7:28.0.0'
//compile 'com.android.support:design:28.0.0'
implementation 'com.android.support:support-v4:24.+'
}android {
/*******************************************************
* The following variables:
* - androidBuildToolsVersion,
* - androidCompileSdkVersion
* - qt5AndroidDir - holds the path to qt android files
* needed to build any Qt application
* on Android.
*
* are defined in gradle.properties file. This file is
* updated by QtCreator and androiddeployqt tools.
* Changing them manually might break the compilation!
*******************************************************/compileSdkVersion 31 buildToolsVersion '28.0.3' ndkVersion '25.1.8937393' sourceSets { main { manifest.srcFile 'AndroidManifest.xml' java.srcDirs = [qt5AndroidDir + '/src', 'src', 'java'] aidl.srcDirs = [qt5AndroidDir + '/src', 'src', 'aidl'] res.srcDirs = [qt5AndroidDir + '/res', 'res'] resources.srcDirs = ['resources'] renderscript.srcDirs = ['src'] assets.srcDirs = ['assets'] jniLibs.srcDirs = ['libs'] } } tasks.withType(JavaCompile) { options.incremental = true } lintOptions { abortOnError false } // Do not compress Qt binary resources file aaptOptions { noCompress 'rcc' } defaultConfig { resConfig "en" minSdkVersion = qtMinSdkVersion targetSdkVersion = qtTargetSdkVersion }
}
-
Now we became paranoid to get things running
so we keep going through points available at https://wiki.qt.io/Qt_5.15_Tools_and_Versions
line by line... so we uninstall JAVA SE 17 compatible stuff in favor of JAVA SE 11 (even though in variety of places it says newer versions of JAVA are all good)
but guess what?
After the JDK is unistalled.... new versions of JDK chosen.... QT CReator 12... it would never recover - look above........
NEVER. -
after one attempts to select NDK's loation by hand (..) wonderful huh?
-