Different dependencies for debug and release in gradle and Android Studio

后端 未结 3 1586
一个人的身影
一个人的身影 2021-01-30 10:39

I have an Android project, that depends on pure Java project. Both of them depend on another Java library, also in my multiproject gradle set in Android Studio. I have two versi

3条回答
  •  我在风中等你
    2021-01-30 10:48

    Build Types (debug, release, or custom) can have their own dependencies.

    To specify a dependency specific to a build type, do the following:

    dependencies {
        debugCompile "mydebugdependency"
        releaseCompile "myreleasedependency"
    }
    

    If your java project and android project are both using gradle, you can do the above in both of their build.gradle files.

提交回复
热议问题