Qt Qml Android studio plugin is crashing
-
I had installed the Qt QML Android Studio extension to add QML to an Android Studio project for testing.
It is a JetPack compose project and I'm using the NavigationBar for better UX. The issue is that I need the Scaffold content property to display QML pages that I am loading using QtQuickView's .loadContent() method.
It seems to work the initially but when I change navigation routes the application crashes with the error:
Now, ChatGPT fixed this issue like so:
The fix seems to make matters worse because now when you navigate to the next route the application crashes and StackTrace is somewhat gibberish.
Has anyone else encountered this??
The StackTrace:
-
So, I figured out the answer, although I am not sure it's efficient. The key is to have a new QtQuickView for every composable item. You can forget about the ChatGPT part, and I recommend checking this StackOverflow answer as well.