QT 6.5 signs debug package
-
When I build my app with QT 6.4.3 for Android in
RelWithDebInfo
configuration the release package is signed:BUILD SUCCESSFUL in 1m 17s 88 actionable tasks: 88 executed Signing file D:/dev/repos/examples/src/MyApp/build-MyAppQt-Android_Qt_6_4_3_arm64_v8a_release_Clang_arm64_v8a-RelWithDebInfo/android-build//build/outputs/bundle/release/android-build-release.aab
But when I try to build my app with QT 6.5.0 in
RelWithDebInfo
configuration the debug package is signed:BUILD SUCCESSFUL in 50s 83 actionable tasks: 43 executed, 40 up-to-date Signing file D:/dev/repos/examples/src/MyApp/build-MyAppQt-Android_Qt_6_5_0_arm64_v8a_release_Clang_arm64_v8a-RelWithDebInfo/android-build//build/outputs/bundle/debug/android-build-debug.aab
what happened in QT 6.5.0?
Also QT Creator 10 displays "Signing a debug package" warning with both QT 6.4.3 and QT 6.5 QT:
When I build my app with QT 6.5.0 in
Release
configuration the release package is signed:BUILD SUCCESSFUL in 55s 88 actionable tasks: 88 executed Signing file D:/dev/repos/examples/src/MyApp/build-MyAppQt-Android_Qt_6_5_0_arm64_v8a_release_Clang_arm64_v8a-Release/android-build//build/outputs/bundle/release/android-build-release.aab
and there is no warning in QT Creator.
So looks like QT Creator or some build scripts do not understand that
RelWithDebInfo
is a release configuration, but not debug.Is there a simple workaround?
Found the following code in QT Creator in https://github.com/qt-creator/qt-creator/blob/master/src/plugins/android/androidbuildapkstep.cpp:
void AndroidBuildApkWidget::updateSigningWarning() { bool nonRelease = m_step->buildType() != BuildConfiguration::Release; bool visible = m_step->signPackage() && nonRelease; m_signingDebugWarningLabel->setVisible(visible); }
where
BuildType
isenum BuildType { Unknown, Debug, Profile, Release };
so the condition
m_step->buildType() != BuildConfiguration::Release
is probably false if my configuration isRelWithDebInfo
Is it a bug?
The workaround is to always generate debug symbols in
Release
configuration:target_compile_options(example_target PRIVATE $<$<CXX_COMPILER_ID:MSVC>:/Zi> $<$<NOT:$<CXX_COMPILER_ID:MSVC>>:-g> )