Since I could find an out of this. I followed this steps. I hope, If somebody find her/himself in this situation, this helps.
Firstly
Put a manifest to desired flavors directory, for my example I've put android manifest to src/projectY and src/projectX
Beware these not to be full manifest. It should be layered like below
<manifest>
<application>
<activity>
android:name=".x.loginActivity"
tools:node="merge" // this is must
// your flavor spesific code
</activity>
</application>
</manifest>
Secondly
Delete your code to minimum in main XML. What i mean that manifest you've created in src/flavor will be merged with main one. so that delete what you want to seperate and leave what you want to used common in main.
Thirdly
Give different manifestPlaceholder name if you need to seperate prod,dev and staging.
For example,
src/projectX/manifest.xml
<activity>
.
.
android:host='${projectXHost}'
.
</activity>
src/projectY/manifest.xml
<activity>
.
.
android:host='${projectYHost}'
.
</activity>
in gradle
productFlavors{
prod {
manifestPlaceholders = [projectXHost : 'xxx' , projectYHost : 'yyy']
}
}
Since this is my first answer, I'm sorry with layout and expressions. I hope you can understand what I mean. Have a good day
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…