Build variants in Gradle for a Library Project in Android

前端 未结 6 1548
爱一瞬间的悲伤
爱一瞬间的悲伤 2020-12-02 12:32

I am trying to configure with Gradle a project which contains some external libraries. With Gradle I can setup different Environmental Configuration (with a class inside a c

6条回答
  •  醉话见心
    2020-12-02 13:09

    It's a @bifmadei answer from google code issue and it helps for me:

    Try setting this in the dependency project

    android {
        publishNonDefault true
        ...
    }
    

    and this in the project that uses it

    dependencies {
        releaseCompile project(path: ':theotherproject', configuration: 'release')
        debugCompile project(path: ':theotherproject', configuration: 'debug')
    }
    

    Taken from here: https://code.google.com/p/android/issues/detail?id=66805

提交回复
热议问题