[Qbs] Android multiarch

Christian Gagneraud chgans at gmail.com
Thu May 14 14:19:48 CEST 2020


On Thu, 14 May 2020 at 23:57, Richard Weickelt <richard at weickelt.de> wrote:
>
>
> > As an experiment, i've just tried Qt-5.14, and this has enabled
> > multi-arch on Android.
> > I can select the list of architecture i want to support with qbs.architectures.
> > This works for libraries, but my application is disabled:
> > Error while handling 'TestApp'
> > Product 'TestApp' had errors and was disabled.
> >
> > 3 of them, and that's all i get. I have 3 Depends that point to
> > internal libraries, maybe that's the smoking gun...
> > I have
> >     multiplexByQbsProperties: ["architectures"]
> >     qbs.architectures: ["arm64", "x86_64"]
> > For libs and apps.
> > I tried as well the 'usesNativeCode' but no success.
> >
> > Any idea what i'm missing?
>
> Can you show us some more code or even a minimal example?

Here is my app module:
CppApplication {
    Depends { name: "Qt.core" }
    Depends { name: "Qt.androidextras"; condition: qbs.targetPlatform
== "android" }
    cpp.includePaths: [  project.sourceDirectory + "/sources", "." ]
    cpp.cxxLanguageVersion: "c++14"
    qbs.architectures: ["arm64", "x86_64"]
    multiplexByQbsProperties: ["architectures", "profiles"]

    Properties {
        condition: qbs.targetPlatform == "android"
        // https://xxxxxxxxxxxxx
        Android.sdk.platform: "android-28"
        Android.sdk.buildToolsVersion: "28.0.3"
        Android.ndk.platform: "android-28"
        // Apk
        Android.sdk.packageName: "xxxx." + name.toLowerCase()
        Android.sdk.versionName: project.versionName
        Android.sdk.versionCode: project.versionCode
        Android.sdk.apkBaseName: "factory-" + name.toLowerCase() + "-"
+ project.versionName
        Android.sdk.manifestFile: sourceDirectory +
"/android/AndroidManifest.xml"
        Android.sdk.keyStorePath: project.sourceDirectory + "/xxxx.jks"
        Android.sdk.keyStorePassword: "xxxx:xxxxx"
        Android.sdk.keyAlias: "xxxxxx"
        Android.sdk.keyPassword: "xxxx:xxxxx"
        // For debugging androiddeployqt issues, set this to true
        // androiddeployqt is only use by qbs to collect dependencies
        //Qt.android_support.verboseAndroidDeployQt: true
    }
}

And my library module:
StaticLibrary {

    Depends { name: "Qt.core" }
    Depends { name: "Qt.androidextras"; condition: qbs.targetPlatform
== "android" }

    cpp.includePaths: [  project.sourceDirectory + "/sources", "." ]
    cpp.cxxLanguageVersion: "c++14"
    multiplexByQbsProperties: ["architectures", "profiles"]
    qbs.architectures: ["arm64", "x86_64"]
}

First time i'm using multi-arch, my understanding is that i should
have 1 APK that support these 2 archs

Chris


More information about the Qbs mailing list