I have two android project with same source code only app icon change in both app. But i don't have use product flavor. now i need to merge source code and use product flavor. so it is possible?
Asked
Active
Viewed 380 times
0
-
I suggest you to take a look at https://developer.android.com/studio/build/manifest-build-variables – Jameido Nov 12 '19 at 18:03
-
Thank you @Jameido, But i don't find out my solutions. – Ankit Dubariya Nov 13 '19 at 05:22
1 Answers
1
What you are looking for has been answered here, basically what you need to do is to create a folder structure that mirrors the main->res->mipmap structure replacing main with your flavour name like this:
-src
-main
-res
-app_one
-res
-mimap-*
-ic_launcher.png
-app_two
-res
-mimap-*
-ic_launcher.png
EDIT
After merging the source code of the 2 projects you need to create 2 different product flavours in your gradle configuration and use the manifest placeholders for things like the app name and package:
productFlavors {
app_one {
applicationId "xxx.yyy.zzz"
}
app_two {
applicationId "aaa.bbb.ccc"
}
}
And in your manifest:
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="${applicationId}">
If the code content is the same you shouldn't have any issue, just select the right buildVariant and keystore when preparing the release apk.

Jameido
- 1,344
- 1
- 11
- 21
-
No no, you are not understand my question, i am saying that, i have two different app (different source code) that already published on PlayStore, and now that have lot of bug (same bug in both source code), so for resolve i required to solve bug in both source code and that wast of timing so i want to merge both source code and then want bug solving in it, now my question is if i am merge both code and creating both signed APK and upload it on PlayStore with new version of APK then it is possible ? or it will give me any error ? – Ankit Dubariya Nov 13 '19 at 09:03
-