[Qbs] Selecting target architecture for Android

Christian Kandeler christian.kandeler at qt.io
Mon May 23 10:12:45 CEST 2022


On 5/22/22 21:57, Alberto Mardegan wrote:
> So far I've built my Android application using Qt 5.12, for the arm 
> architecture only, and everything has worked fine.
>
> Today I tried migrating to 5.15, which supports multiarch, and I'm 
> getting an issue: after building all the files for all the four 
> supported architectures ("Qt with multiple abi detected: 
> 'armeabi-v7a,arm64-v8a,x86,x86_64'"), I get an error during the 
> install phase:
>
> ======
> ERROR: Cannot install files 
> '/home/mardy/src/git/mappero/abuild/default/MapperoCore.eyJhcmNoaXRlY3R1cmUiOiJ4ODZfNjQifQ--.8341646d/libMapperoCore.so' 
> and 
> '/home/mardy/src/git/mappero/abuild/default/MapperoCore.eyJhcmNoaXRlY3R1cmUiOiJhcm02NCJ9.14539b45/libMapperoCore.so' 
> to the same location 
> '/home/mardy/src/git/mappero/abuild/default/install-root/usr/local/lib/libMapperoCore.so'. 
> If you are attempting to install a directory hierarchy, consider using 
> the qbs.installSourceBase property.
> ======

Presumably you have set qbs.install to true somewhere in the library 
product, with no per-arch differentiation, leading to  a conflict. Since 
in the Android case the libraries are not the final build artifact, they 
should not get installed.

> where MapperoCore is a DynamicLibrary. But actually I didn't spend 
> time investigating this (and neither should you), because I don't 
> really care about other architectures: I would be happier if my 
> Android package contained just the armv7 binaries :-)
>
> But how do I do that? I tried specifying 
> "qbs.architectures:armeabi-v7a" to QBS's command line, but then it 
> looks like it cannot find the Qt libraries:

NDK ABI name and qbs architecture name are not always the same. I 
suppose qbs.architecture would be armv7a here.


Christian




More information about the Qbs mailing list