In a Qt Quick app, when the app window is invisible by default (to be made visible shortly thereafter), Qt assertion fails:
qt/qtbase/src/corelib/global/qglobal.cpp:3070 (void qt_assert(const char*, const char*, int)): ASSERT: "m_windowStack.contains(window)" in file /Users/chris/Projects/Suitable/qt/qtbase/src/plugins/platforms/android/qandroidplatformscreen.cpp, line 162
It's pretty clear what's happening. In "qandroidplatformscreen.cpp", window objects (QAndroidPlatformWindow) are added/removed from 'm_windowStack'. In "qandroidplatformwindow.cpp" function 'QAndroidPlatformWindow::setVisible' calls either 'addWindow' if visible or 'removeWindow' if invisible. 'QAndroidPlatformScreen::removeWindow' asserts that 'm_windowStack' contains the window prior to removing it, which is not the case if the window is not initially visible.
So it seems to me that either the caller (setVisible) should check to see that the window can be removed prior to calling 'removeWindow', or else 'removeWindow' should not make such an assertion.