Douts with flavors and packages names

Viewed 87

I have two Flavors on my app, so my project has this structure:

productFlavors {
            green {
                resValue "string", "app_name", "green"
                minSdkVersion 14
                applicationId 'com.company.green'
                targetSdkVersion 22
                versionCode 3
                versionName '3.0.3'
            }

            red {
                resValue "string", "app_name", "red"
                minSdkVersion 14
                applicationId 'com.company.red'
                targetSdkVersion 22
                versionCode 3
                versionName '3.0.3'
                 }
             }          

Also I have different class implementation in every Flavor and commun classes in the main package.
Now let´s say that I have to implement the class:

MyClass

That class will have a different implementation for each flavor , so I am implementing the class inside of the green and red Flavor

After create MyClass on the green Flavor I am getting in the this error in the class itself.

package name com.company.MyClass does not correspond to the file path

I have also try with

package com.company.green.MyClass

But I am getting the same package name error

So my question is : What is correct package name for each Flavor ?

1 Answers
Related