-
Notifications
You must be signed in to change notification settings - Fork 1
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
Plugin paths in AndroidManifest.xml not correctly resolved #1
Comments
When building and deploying a basic Qml Android app this is the layout of the /android-build/libs folder:
But the internal layout of the apk (android-build-debug) is:
The plugins and the qml files did not get copied properly, not sure if there are more files missing. |
Yes, the APK is obviously missing plugins in your case. That means you don't even come far enough to reproduce the issue I've been reporting. So let's talk about the issue you've encountered first :-) I didn't notice it because I'm using CMake and I've written my own CMake module to produce android-deployment.json with the correct paths. But I've been hardcoding paths before too and had to adapt it. So |
In my case I'm using Qmake which is the default build system, did not tried with Cmake yet.
I tried to find information on that android-deployment.json file but it's not located in the system and grepping qt-everywhere-src does not give any result, is it a Cmake thing or I'm missing something?
If you do:
the paths are correct but androiddeployqt does not seems to be using those paths at all, did not read the source code at all so not sure. |
So the actual name of this file might be different when using qmake. In fact
I'm aware. My adjusted CMake module actually uses |
Get it, in the root of the source code, qmake put a *-deployment-settings.json file.
|
Here I changed qml with lib/qt/qml, and then added "deployment-dependencies": "lib" to the json file, this basically copies the whole lib folder into the apk, far from ideal but whatever. And now I'm getting this error:
Afaik NDK apps needs an activity class to load the binary as explained here,androiddeployqt is supposed to take all java binding files and compile into the .dex file and it's not doing that. Without the "deployment-dependencies": "lib" line I get this error.
Idk, I'm quite lost with this. |
I suppose I did that better in my CMake module. But I still end up having lots of plugins I actually don't need.
Yes, looks like some Java code couldn't be dexed correctly. I haven't run into this issue so far. I can share the JSON file for androiddeployqt produced by my CMake module and also the exact invocation of the tools when I'm accessing the computer where I've built that stuff again. Otherwise you can checkout qtutilities/passwordmanager from my GitHub. That are my demo/practicing projects for Qt stuff and also contain the configuration files and build system magic the Android build. |
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
I've reported the issue in Qt issue tracker. |
Great thanks! |
This is not going anywhere 😕
And there are a lot of hard coded paths relative to the prefix. |
Wait, I thought this "It has unmet dependencies" log message only means that the plugin is not bundled because the application does not make use of the related Qt module. So the plugin What actually works for me is this CMake module to invoke androiddeployqt: https://github.com/Martchus/qtutilities/blob/master/cmake/modules/AndroidApk.cmake It uses |
And you are right, I was not able to test well the apk because I have some problems with Qt Creator not detecting the installed images. The apk runs well if I leave the install paths untouched.
But even so users expect Qt Creator templates to be ready to use, they expect to press the run button, get the apk compiled, and then launch and Android image with the app running, also even when Qt supports cmake, qmake is the default build systems and that is what users expect. Adding a 3rd-party dependency is not a solution here.
androiddeployqt has many hard dependencies relative to the install prefix (1 2 3 4 5), and the paths referenced in /opt/android-libs//lib/-android-dependencies.xml are always relative to the prefix. *-android-dependencies.xml files are generated by qt_android_deps.prf, and grepping for example:
androiddeployqt is ignoring install paths completely. I'll continue making more tests. |
Most definitely. This bug makes the package unusable for most use cases. Is there a (temporary) solution to brige the gap between the "old" way (what was working with the 5.11 version of the package) and the current package? Like symlinking the directories to emulate the previous hierarchy while keeping the new "common" hierarchy ? |
I have updated the packages, it may be working now, I have tested with the Qt Quick Application template in Qt Creator. Some notes:
Yes, and I did so with latest changes, the problem will be when they release an hypothetical Qt6 in the future, if they don't fix this bug, you will be not able to have installed Qt5 and Qt6 at same time, for example sending all qml and plugins files to lib/qt5/qml and lib/qt5/plugins (for Qt5), and lib/qt6/qml and lib/qt6/plugins (for Qt6). |
Yes thanks, I tested the armv8 version and it's working again! |
I just installed the android-armv7a-eabi-qt5 package from aur and I'm getting this error when executing an example program on android:
Something still not right with the .so files. I have the following android packages in my pc:
|
@lsevero executed in an Android phone or the emulator? |
In an android phone with android 9. |
I did not tested any app in a phone yet, but it could be that your phone is arm64-v8a instead of armv7a-eabi? Edit Could this be related? |
The original problem is already solved, closing issue before it goes offtopic. |
Since changing the paths the
%%INSERT_LOCAL_LIBS%%
placeholder inAndroidManifest.xml
is not resolved correctly anymore.I get
lib/qt/plugins/platforms/android/libqtforandroid.so:lib/qt/plugins/bearer/libqandroidbearer.so:lib/libQt5QuickParticles.so
instead ofplugins/platforms/android/libqtforandroid.so:plugins/bearer/libqandroidbearer.so:lib/libQt5QuickParticles.so
. Despite changing the paths the latter still seems correct. The incorrect version prevents the application to start at all because C++ functions provided by the platform plugin can not be loaded, eg.:I had also applied your patch
0003-Fix-androiddeployqt-search-paths.patch
when building Qt. So it at least does not fix this or maybe this bug is even an unwanted side-effect of that patch.Of course one can easily workaround the issue by hard-coding the path instead of using the placeholder: Martchus/passwordmanager@06c2807
So it is not really important.
The text was updated successfully, but these errors were encountered: