

For simplicity's sake, let's assume the only difference between the two apps is that the free app has ads, while the premium version is ad-free.įor the mentioned example, the adle would look like this: android section. Let's look at a simple example of having an app, which has a basic free and a paid premium version of the app.

Implementation Step #1: How to Setup ProductFlavor-Dependent Dependencies The different productFlavors are requiring different sets of dependencies (otherwise it doesn't make sense and just adds complexity).

You must have one code base/project with multiple productFlavors.You must be using the Gradle build system What happens when they are set to different values According to the Toolchain and compatibility section of the Java plugin Gradle documentation: sourceCompatibility is 'Java version compatibility to use when compiling Java source.' targetCompatibility is 'Java version to generate classes for.As with the previous posts, before you get excited, there are a few requirements:
