0

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.

eyllanesc
  • 235,170
  • 19
  • 170
  • 241
Olaf Japp
  • 480
  • 5
  • 19
  • [Related question](https://stackoverflow.com/q/35342222) for the case when QML files and not `.so` libraries are missing from the generated Android APK package. – tanius Jun 11 '20 at 14:45

2 Answers2

1

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.

Olaf Japp
  • 480
  • 5
  • 19
-1

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!

xtcuser
  • 7
  • 3
  • I want to deploy an Android app. So deployqt is not an option and there is no folder where I could copy the files into. I am still talking about to deploy a apk. – Olaf Japp Jul 05 '19 at 11:03