How can I specify per flavor buildType sourceSets?

前端 未结 2 1170
南笙
南笙 2020-12-17 15:35

I\'ve got 2 flavors of an app that each have their own google maps (v1) key for debug and release (meaning 4 keys total). So I\'d like to know if I can specify sourceSets ba

2条回答
  •  不思量自难忘°
    2020-12-17 16:13

    For Google Maps API integration you can check my gradle sample code here : https://github.com/shakalaca/learning_gradle_android/tree/master/07_tricks

    Basically do a little trick in android.applicationVariants.all during the mergeResources phase, and place the API key in strings.xml under different flaver/buildtype combination folder.

提交回复
热议问题