Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for Android #3

Open
seijikun opened this issue Jun 27, 2020 · 1 comment
Open

Support for Android #3

seijikun opened this issue Jun 27, 2020 · 1 comment

Comments

@seijikun
Copy link

Hey!
Thank you for this example using CMake.
That really helps, since the original documentation is qmake only.

I added support for building for Android (diff).
Though, unfortunately, the plugin is not properly deployed, so the app crashes on startup.
During build I see this:

Warning: QML import could not be resolved in any of the import paths: my.plugin.example
Warning: QML import could not be resolved in any of the import paths: QtQuick.Controls.Universal.impl
Warning: QML import could not be resolved in any of the import paths: QtQuick.Controls.impl
Warning: QML import could not be resolved in any of the import paths: QtQuick.Controls.impl
Warning: QML import could not be resolved in any of the import paths: QtQuick.Controls.Fusion.impl
Warning: QML import could not be resolved in any of the import paths: QtQuick.Controls.Material.impl
Warning: QML import could not be resolved in any of the import paths: QtQuick.Controls.Imagine.impl
Warning: QML import could not be resolved in any of the import paths: QtQuick.Controls.Imagine.impl

and the app crashes with:

W libapp.so: QQmlApplicationEngine failed to load component
W libapp.so: qrc:/main.qml:6 module "my.plugin.example" is not installed

I've tried for several hours, but I don't know enough about how all of this qml module stuff works behind the scenes, so I was not able to fix it.
Maybe you could help here?

@4rtzel
Copy link
Owner

4rtzel commented Jul 30, 2020

I've never tested this on Android, unfortunately. I remember trying to run a simple Qt app on Andriod (without any plugins) and the setup was rather tricky. Anyway, here are a couple of ideas:

From the look of the errors you posted, it seems that the Android app wasn't able to find the plugin library. You can try QT_DEBUG_PLUGINS and QML_IMPORT_TRACE environment variables to make Qt spew out some more information about the plugin loading but I'm not sure if it will work on Android.

Have you tried following the Qt's official guide for Android app development (https://doc.qt.io/qtcreator/qt-creator-accelbubble-example.html). It seems that CMake is officially supported as a build system so you might want to try to use the project from their documentation as a skeleton. After you make sure you could deploy it as an Android app, you then could start adding the plugin code from this project.

I hope this helps, @seijikun!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants