且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何在Android上部署Qt imageformats插件

更新时间:2023-02-26 22:18:34

在@Felix回答之后,ANDROID_EXTRA_PLUGINS是正确的,但是它的工作原理有点奇怪.

Following @Felix answer, ANDROID_EXTRA_PLUGINS is correct, but how it works is a bit strange.

在有关此功能缺少文档的讨论之后,此处,还有一些反复试验,我发现了

Following a discussion on the lack of doc for this feature here, and some trial and error, i found that;

ANDROID_EXTRA_PLUGINS必须指定一个目录,而不是文件.因此,您指向自己的插件目录.该目录下的内容(包括子目录)与我原来的问题一样混乱,并在下面进行了解释.

ANDROID_EXTRA_PLUGINS must specify a directory, not a file. So you point to a plugins directory of your own. Things below this directory (including subdirectories) get mangled as in my original question and explained below.

因此,对于我的插件libqapng.so,我有:

So, for my plugin libqapng.so, i have:

ANDROID_EXTRA_PLUGINS += <some path>/plugins

和我构建的Android插件.pro将输出放入;

and my android plugin building .pro puts the output in;

<some path again>/plugins/imageformats/libqapng.so

.so库,然后卷入其中(例如,对于手臂);

The .so lib, then winds up mangled in (eg. for arm);

android-build/libs/armeabi-v7a/libplugins_imageformats_libqapng.so

和资源获得条目;

android-build/res/values/libs.xml

    <array name="bundled_in_lib">
    ...
<item>libplugins_imageformats_libqapng.so:plugins/imageformats/libqapng.so</item>
</array>

根据需要.

感谢@Felix给出了几乎所有的答案,但我想我会在这里写下其他详细信息,以使他人受益.

Thanks to @Felix for almost the answer, but i thought I'd write up the extra details here for the benefit of others.