Android wear application packaging fails with flavours

前端 未结 4 880
借酒劲吻你
借酒劲吻你 2020-12-13 15:19

I have an application that includes a wear app. All works fine on debug tested with a real device. I can alse create the release apk that packs the wear apk inside it. But o

4条回答
  •  萌比男神i
    2020-12-13 15:26

    The flavor of the parent app isn't propagated automatically to the Wear project. You have to map it explicitly.

    Instead of this:

    dependencies {
        wearApp project(':myWearApp')
    }
    

    Do this:

    In your Wear app:

    android {
        publishNonDefault true
    }
    

    In your parent app:

    dependencies {
        TrialWearApp project(path: ':myWearApp', configuration: 'Trial')
        FullWearApp project(path: ':myWearApp', configuration: 'Full')
    }
    

提交回复
热议问题