Reputation: 3585
The latest episode in the never ending task of dealing with Googles string of breaking changes involves flavors. Several months ago I implemented two flavors and then things worked fine. Recently I upgraded to Android Studio 3.0.1 and brought my app up to android N. After this update my app would no longer compile complaining that flavors now must reference “flavorDimensions”. The attached picture shows my implementation of flavorDimensions. However now it is complaining that I have duplicate Constants.java files since the platform updates. These files each contain an enum for their respective flavors…
package com.deanblakely.SafeTalk;
/**
* this is the one for the SafeTalk flavor
*/
public class Constants {
public enum Type
{
SafeTalk, SecureChannel;
}
public static final Type type = Type.SafeTalk;
}
package com.deanblakely.SafeTalk;
/**
* this is the one for the SecureChannel flavor */
public class Constants {
public enum Type
{
SafeTalk, SecureChannel;
}
public static final Type type = Type.SecureChannel;
}
The flavors won't work if I delete them.
These two Constants.java were tolerated by the older platforms but not by the new. My research has yet to find a solution.
Upvotes: 0
Views: 261
Reputation: 1006539
Use one flavor dimension, not two. Both flavors go into that one flavor dimension.
Upvotes: 1