[Qbs] Android and shared libraries in APK

Alberto Mardegan mardy at users.sourceforge.net
Sat Jul 11 12:18:16 CEST 2020


Hi all,
  sorry for the week-end spamming :-)

My project consists of an executable file and two shared libraries. The
Android build is failing right at the end, with this message:

ERROR: Qt applications for Android support only one native binary per
package.

On the other hand, the documentation [1] seems to imply that multiple
libraries are allowed:

  "You can use the DynamicLibrary item to build native Android libraries
  that are bundled into the APK"

I've looked into the QBS code, and I'm not sure I understand the checks
being performed there [2] (or better, what their goal is). It looks like
that if the first native library found has a name which matches the
product name, then one can have as many other libraries as desired; but
if the list of libraries contains as the first two elements two
libraries whose name does not match the product name, then the exception
is thrown.

So, I suspect that the code there is wrong, since it depends on the
order of the items in the array. But it's not clear to me how to fix it,
because I don't understand what should be allowed, and what should not.

I guess that the desired outcome is that there is only one shared
library whose name matches the product.name; is my understanding correct?

Ciao,
  Alberto


[1]: https://doc.qt.io/qbs/qbs-target-android.html
[2]:
https://github.com/qbs/qbs/blob/master/share/qbs/module-providers/Qt/templates/android_support.qbs#L97-L120

-- 
http://www.mardy.it - Geek in un lingua international


More information about the Qbs mailing list