在应对谷歌不断变化的任务中,最新一集涉及口味。几个月前,我实现了两种口味,然后一切正常。最近,我升级到了Android Studio 3.0.1,并将我的应用升级到了Android N。更新后,我的应用程序将不再编译,因为我抱怨现在的口味必须引用“flavorDimensions”。
附图显示了我对flavorDimensions的实现。然而,现在它抱怨我有重复的常量。平台更新后的java文件。这些文件各自包含各自风格的枚举
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;
}
如果我删除它们,味道就不会起作用。
这两个常数。旧平台可以容忍java,但新平台不能容忍java。我的研究还没有找到解决办法。