How to add required libraries to a pyqtdeploy project file for an Android app?

520 Views Asked by At

I have already successfully deployed a QtWigets app to Android using PyQt5 and pyqtdeploy. However when I want to deploy a QML based app the app crashes. What I found out is that Qt5QuickTemplates2.so and Qt5QuickControls2.so are missing for the following QML snippet:

import Quick 2.0
import QuickControls 2.5
...

How can I declare these libraries in the project file?
There are no ckeckable entries in Qt section.
There is just QtQuick and QtQml.

2

There are 2 best solutions below

0
Olaf Japp On BEST ANSWER

Luckily I found a solution.

It's not documented anywhere so I only know this workaround.
Before running androiddeployqt I had to copy a valid QML file into the build-directory where androiddeployqt can find this file.
Have a look into the android-lib*.so-deployment-settings.json file in the build-directory for the key "qml-root-path":
There a qml-root has been set. In my case it was build-android-32.

androiddeployqt is scanning this file and maybe also dependent qml files for import statements. And then it knows which additional libraries to deploy.

1
xtcuser On

You can try deployqt applications.

  • If you are using Linux, try linuxdeployqt from here
  • If you are using Windows, try windeployqt from here

Alternative Solution:

  • Just copy all of the libraries and plugins inside your application path
  • Change the name of Qt folder
  • Execute the application
  • Try to remove all of the libraries and plugins (Not as root)
  • The system will tell you that files using by app cannot be deleted.

Cheers!