最新国产好看的视频,伊人天堂AV在线,国产Aaaaaa视频,蜜臀视频在线观看一区,人妻av色图,密臀久久久精品影片,青青视频免费观看毛片,久草在线观看视,国产三级精品色情在线

Android studio 3.0上進(jìn)行多渠道打包遇到的問(wèn)題小結(jié)(超簡(jiǎn)潔版)

 更新時(shí)間:2017年11月01日 13:55:37   作者:small_technical  
這篇文章主要介紹了Android studio 3.0上進(jìn)行多渠道打包遇到的問(wèn)題小結(jié)(超簡(jiǎn)潔版),非常不錯(cuò),具有參考借鑒價(jià)值,需要的朋友可以參考下

Error:All flavors must now belong to a named flavor dimension. The flavor 'xiaomi' is not assigned to a flavor dimension. Learn more at https://d.android.com/r/tools/flavorDimensions-missing-error-message.html

Android studio 3.0上進(jìn)行多渠道打包時(shí)編譯時(shí)出現(xiàn)這個(gè)錯(cuò)誤

多渠道打包參考:http://m.fzitv.net/article/127340.htm

解決問(wèn)題參考:https://stackoverflow.com/questions/44105127/android-studio-3-0-flavor-dimension-issue

多渠道打包的細(xì)節(jié)我就不說(shuō)了,參考網(wǎng)絡(luò)上的,或者我上面的這個(gè)鏈接就好,下面給出一下我修改的代碼(如果有其他的改法也希望能多多交流)

flavorDimensions "default" 
 productFlavors { 
 kuan { 
  dimension "default" 
  manifestPlaceholders = [UMENG_CHANNEL_VALUE: "kuan"] 
 } 
 xiaomi { 
  dimension "default" 
  manifestPlaceholders = [UMENG_CHANNEL_VALUE: "xiaomi"] 
 } 
 qh360 { 
  dimension "default" 
  manifestPlaceholders = [UMENG_CHANNEL_VALUE: "qh360"] 
 } 
 baidu { 
  dimension "default" 
  manifestPlaceholders = [UMENG_CHANNEL_VALUE: "baidu"] 
 } 
 wandoujia { 
  dimension "default" 
  manifestPlaceholders = [UMENG_CHANNEL_VALUE: "wandoujia"] 
 } 
 } 

或者: 

flavorDimensions "default" 
 productFlavors { 
  kuan {dimension "default"} 
  xiaomi {dimension "default"} 
  qh360 {dimension "default"} 
  baidu {dimension "default"} 
  wandoujia {dimension "default"} 
 } 
 productFlavors.all { 
  flavor -> flavor.manifestPlaceholders = [UMENG_CHANNEL_VALUE: name] 
 } 

然后解決問(wèn)題之后我又去官網(wǎng)查閱了一下,地址如下:

https://developer.android.com/studio/build/build-variants.html#flavor-dimensions

根據(jù)官網(wǎng)說(shuō)法:

You must assign each product flavor you configure to one of the flavor dimensions.

你必須指定一種 flavor dimensions

void flavorDimensions(String... dimensions) 

flavorDimensions 后面可以添加多個(gè)不同類型的參數(shù)例如:

flavorDimensions "api", "mode" 

接下來(lái)的使用對(duì)應(yīng)起來(lái)就好了:

productFlavors { 
 demo { 
  // Assigns this product flavor to the "mode" flavor dimension. 
  dimension "mode" 
  ... 
 } 
 full { 
  dimension "mode" 
  ... 
 } 
 // Configurations in the "api" product flavors override those in "mode" 
 // flavors and the defaultConfig {} block. Gradle determines the priority 
 // between flavor dimensions based on the order in which they appear next 
 // to the flavorDimensions property above--the first dimension has a higher 
 // priority than the second, and so on. 
 minApi24 { 
  dimension "api" 
  minSdkVersion '24' 
  // To ensure the target device receives the version of the app with 
  // the highest compatible API level, assign version codes in increasing 
  // value with API level. To learn more about assigning version codes to 
  // support app updates and uploading to Google Play, read Multiple APK Support 
  versionCode 30000 + android.defaultConfig.versionCode 
  versionNameSuffix "-minApi24" 
  ... 
 } 
 minApi23 { 
  dimension "api" 
  minSdkVersion '23' 
  versionCode 20000 + android.defaultConfig.versionCode 
  versionNameSuffix "-minApi23" 
  ... 
 } 
 minApi21 { 
  dimension "api" 
  minSdkVersion '21' 
  versionCode 10000 + android.defaultConfig.versionCode 
  versionNameSuffix "-minApi21" 
  ... 
 } 
 } 

好了,這就是官方給出的gradle多渠道打包的方式

總結(jié)

以上所述是小編給大家介紹的Android studio 3.0上進(jìn)行多渠道打包遇到的問(wèn)題小結(jié)(超簡(jiǎn)潔版),希望對(duì)大家有所幫助,如果大家有任何疑問(wèn)請(qǐng)給我留言,小編會(huì)及時(shí)回復(fù)大家的。在此也非常感謝大家對(duì)腳本之家網(wǎng)站的支持!

相關(guān)文章

最新評(píng)論

景泰县| 高州市| 梅河口市| 保德县| 东辽县| 抚州市| 富源县| 屏东县| 商河县| 金阳县| 金湖县| 海宁市| 大连市| 花垣县| 永顺县| 隆安县| 花莲县| 西乌| 教育| 哈巴河县| 玉树县| 姚安县| 苏尼特右旗| 昔阳县| 凌源市| 四子王旗| 福贡县| 平安县| 信宜市| 霍邱县| 昌平区| 墨竹工卡县| 宜宾市| 阜新| 佛山市| 南投县| 台中县| 改则县| 安康市| 望都县| 襄汾县|