国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 系統(tǒng) > Android > 正文

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

2019-12-12 01:45:48
字體:
供稿:網(wǎng)友

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)行多渠道打包時編譯時出現(xiàn)這個錯誤

多渠道打包參考://m.survivalescaperooms.com/article/127340.htm

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

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

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ǎng)查閱了一下,地址如下:

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

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

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

你必須指定一種 flavor dimensions

void flavorDimensions(String... dimensions) 

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

flavorDimensions "api", "mode" 

接下來的使用對應(yīng)起來就好了:

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)行多渠道打包遇到的問題小結(jié)(超簡潔版),希望對大家有所幫助,如果大家有任何疑問請給我留言,小編會及時回復(fù)大家的。在此也非常感謝大家對武林網(wǎng)網(wǎng)站的支持!

發(fā)表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發(fā)表
主站蜘蛛池模板: 正蓝旗| 新竹市| 石台县| 太原市| 沁源县| 牙克石市| 阳东县| 孟津县| 同仁县| 宽甸| 宜章县| 深泽县| 碌曲县| 峨山| 镇赉县| 鄱阳县| 赫章县| 石城县| 文昌市| 韶关市| 连云港市| 聊城市| 夹江县| 延寿县| 广州市| 阿城市| 灵寿县| 新干县| 花莲县| 平果县| 河源市| 荔波县| 海丰县| 临夏市| 眉山市| 高淳县| 彩票| 于田县| 乐东| 筠连县| 兴文县|