Android Studio 3.0.1中的android风格问题

问题描述 投票:0回答:1

处理Googles一系列突破性变化的永无止境任务的最新一集涉及风味。几个月前,我实现了两种口味,然后一切正常。最近我升级到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被较旧的平台所容忍,但不被新的平台所容忍。我的研究尚未找到解决方案。

enter image description here

android android-productflavors
1个回答
1
投票

使用一个风味维度,而不是两个。两种口味都进入了一种风味维度。

© www.soinside.com 2019 - 2024. All rights reserved.