Qt bootstrap assumes every native Qt library has a corresponding PySide wrapper
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Idoneità per principianti
- 65/100
- Tipo di issue
- Bug
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Attiva
- Stack tecnologico
- android, python
- Ambito
- build-system, mobile
Direzione di ricerca
Start with the Qt bootstrap template at pythonforandroid/bootstraps/qt/build/templates/libs.tmpl.xml, which emits both Qt6<Module>``_<arch> native entries and Qt<Module>.abi3.so wrapper entries from the same qt_libs list, and then check how build.py in pythonforandroid/bootstraps/common/build/ passes that list. Done means the generated load_local_libs contains only wrapper libraries that exist in the PySide wheel, such as no QtQmlModels.abi3.so, with a separate pyside-libs option falling back to qt_libs. Confirm this by rendering the template and checking the output, since the reporter says the change works on an arm64 emulator.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Title: Qt bootstrap assumes every native Qt library has a corresponding PySide wrapper
Description:
I found an issue in the python-for-android Qt bootstrap when it is used by PySide6.
Environment:
- PySide6: 6.12
- Python: 3.14
- Android ABI: arm64-v8a
- Android emulator: Android 16
- Android NDK: r28c
- Qt Quick / Qt Quick Controls
The PySide Android deployment correctly needs to pass native Qt dependencies such as:
Core
Gui
Network
Qml
OpenGL
QmlModels
QmlWorkerScript
QmlMeta
Quick
QuickTemplates2
QuickControls2
The problem is in:
pythonforandroid/bootstraps/qt/build/templates/libs.tmpl.xml
The current template iterates over qt_libs and generates both:
Qt6<Module>_<arch>
for native Qt libraries, and:
Qt<Module>.abi3.so
for PySide wrapper libraries.
These two sets are not equivalent.
Some native Qt dependencies do not have a corresponding PySide wrapper library.
For example:
QmlModels
QmlWorkerScript
QmlMeta
QuickTemplates2
are valid native Qt dependencies, but the corresponding wrapper libraries do not exist in the PySide wheel:
QtQmlModels.abi3.so
QtQmlWorkerScript.abi3.so
QtQmlMeta.abi3.so
QtQuickTemplates2.abi3.so
As a result, the generated load_local_libs array can contain non-existent libraries.
The runtime then fails with an error like:
dlopen failed: library ".../QtQmlModels.abi3.so" not found
java.lang.UnsatisfiedLinkError
Loading Qt native libraries failed
Root cause:
qt_libs is currently used for two different purposes:
- native Qt libraries;
- PySide wrapper libraries.
This assumption is not always valid.
Suggested solution:
Introduce a separate list/argument for PySide wrapper modules, for example:
--pyside-libs
Then:
qt_libs
should be used only for native Qt libraries, while:
pyside_libs
should be used only to generate:
Qt<Module>.abi3.so
entries in load_local_libs.
For backward compatibility, if --pyside-libs is not provided, it could fall back to qt_libs.
Conceptually:
pyside_libs = (
args.pyside_libs.split(",")
if args.pyside_libs
else qt_libs
)
and in libs.tmpl.xml:
{%- for pyside_lib in pyside_libs %}
<item>{{ arch }};Qt{{ pyside_lib }}.abi3.so</item>
{% if pyside_lib == "Qml" -%}
<item>{{ arch }};libpyside6qml.abi3.so</item>
{% endif %}
{%- endfor -%}
I implemented this locally and tested it successfully.
After separating native Qt libraries from PySide wrapper libraries:
- the application starts correctly;
- Qt Quick Controls work;
- no non-existent
Qt*.abi3.solibraries are loaded; - no
UnsatisfiedLinkErroroccurs; - QML to Python interaction works correctly.
The relevant files are:
pythonforandroid/bootstraps/common/build/build.py
pythonforandroid/bootstraps/qt/build/templates/libs.tmpl.xml
This issue is related to PySide Android deployment, because PySide may need to pass native Qt-only dependencies which do not have Python wrapper libraries.
I have a working local implementation and can provide the diff if useful.
- Lingua principale
- Python
- Stelle
- 8.9k
- Fork
- 2.1k
- Merge medio
- 3g 19h
- PR unite (30g)
- 7
Preparare l'ambiente
- Include un Dockerfile o un file Docker Compose
- Nessun modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di kivy/python-for-android
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 62/100
kivy/python-for-android#3405 · 1 reazione ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
kivy/python-for-android#3335 · 1 commento · 3 reazioni ·
-
Documentation easy
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
kivy/python-for-android#3326 · 1 commento ·
-
Documentation easy Priority: Low
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 88/100
kivy/python-for-android#3299 ·
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 57/100
kivy/python-for-android#3409 ·
Tutte le issue di kivy/python-for-android
Issue simili
-
Document style: tablesAperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 66/100
-
Successor registrant to review: Navient Holdings, Inc. (CIK 2152623), 8-K12B 0001193125-26-436899Apertasuccessor-review
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
dgunning/edgartools#1889 ·
I maintainer di solito rispondono entro 1 giorno
-
`destroy` sans terminal répond « Aborted. » au lieu de réclamer `--yes` comme `clean` et `reset`Apertabug
Difficoltà 2/5 1-3 ore Idoneità per principianti 85/100
stephrobert/dsoxlab#354 ·
I maintainer di solito rispondono entro 1 giorno
-
hardware help wanted testing
Difficoltà 2/5 1-3 ore Idoneità per principianti 62/100
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
mediajunkie/piper-morgan-product#2335 · 1 commento ·