美文网首页
All flavors must now belong to a

All flavors must now belong to a

作者: 大大大寒 | 来源:发表于2019-03-07 17:59 被阅读0次

    原因android studio 3.0新特性

    解决办法

    https://developer.android.com/studio/build/build-variants?utm_source=android-studio#flavor-dimensions

    看不懂没关系
    小白教程:

    flavorDimensions "android" //productFlavors上面新添加一行
    productFlavors {
            google {
                dimension "android"  //新添加一行
                manifestPlaceholders = [UMENG_CHANNEL_VALUE: "谷歌市场"]
            }
            baidu {
                dimension "android"//新添加一行
                manifestPlaceholders = [UMENG_CHANNEL_VALUE: "百度手机助手"]
            }
    }
    

    官方教程:

      // Specifies the flavor dimensions you want to use. The order in which you
      // list each dimension determines its priority, from highest to lowest,
      // when Gradle merges variant sources and configurations. You must assign
      // each product flavor you configure to one of the flavor dimensions.
      flavorDimensions "api", "mode"
    
      productFlavors {
        demo {
          // Assigns this product flavor to the "mode" flavor dimension.
          dimension "mode"
          ...
        }
    
        full {
          dimension "mode"
          ...
        }
    
    

    相关文章

      网友评论

          本文标题:All flavors must now belong to a

          本文链接:https://www.haomeiwen.com/subject/zzjhpqtx.html