Android Studio 3.0.1 中 android 风格的问题
issue with android flavors in Android Studio 3.0.1
处理 Google 的一连串重大变更的永无止境的任务的最新一集涉及口味。几个月前,我实现了两种口味,然后一切正常。最近我升级到 Android Studio 3.0.1 并将我的应用程序升级到 android N。此更新后我的应用程序将不再编译并抱怨风味现在必须引用“flavorDimensions”。
附图显示了我对 flavorDimensions 的实现。但是现在它抱怨说自平台更新以来我有重复的 Constants.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;
}
如果我删除这些口味,它们将无法使用。
这两个 Constants.java 旧平台可以容忍,但新平台不能容忍。我的研究还没有找到解决方案。
使用一个 风味维度,而不是两个。两种口味都属于一个 口味维度。
处理 Google 的一连串重大变更的永无止境的任务的最新一集涉及口味。几个月前,我实现了两种口味,然后一切正常。最近我升级到 Android Studio 3.0.1 并将我的应用程序升级到 android N。此更新后我的应用程序将不再编译并抱怨风味现在必须引用“flavorDimensions”。 附图显示了我对 flavorDimensions 的实现。但是现在它抱怨说自平台更新以来我有重复的 Constants.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;
}
如果我删除这些口味,它们将无法使用。
这两个 Constants.java 旧平台可以容忍,但新平台不能容忍。我的研究还没有找到解决方案。
使用一个 风味维度,而不是两个。两种口味都属于一个 口味维度。