91超碰碰碰碰久久久久久综合_超碰av人澡人澡人澡人澡人掠_国产黄大片在线观看画质优化_txt小说免费全本

溫馨提示×

溫馨提示×

您好,登錄后才能下訂單哦!

密碼登錄×
登錄注冊×
其他方式登錄
點擊 登錄注冊 即表示同意《億速云用戶服務條款》

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

發布時間:2020-08-22 09:12:59 來源:腳本之家 閱讀:162 作者:small_technical 欄目:移動開發

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上進行多渠道打包時編譯時出現這個錯誤

多渠道打包參考:https://www.jb51.net/article/127340.htm

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

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

flavorDimensions "default" 
 productFlavors { 
 kuan { 
  dimension "default" 
  manifestPlaceholders = [UMENG_CHANNEL_VALUE: "kuan"] 
 } 
 xiaomi { 
  dimension "default" 
  manifestPlaceholders = [UMENG_CHANNEL_VALUE: "xiaomi"] 
 } 
 qh460 { 
  dimension "default" 
  manifestPlaceholders = [UMENG_CHANNEL_VALUE: "qh460"] 
 } 
 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"} 
  qh460 {dimension "default"} 
  baidu {dimension "default"} 
  wandoujia {dimension "default"} 
 } 
 productFlavors.all { 
  flavor -> flavor.manifestPlaceholders = [UMENG_CHANNEL_VALUE: name] 
 } 

然后解決問題之后我又去官網查閱了一下,地址如下:

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

根據官網說法:

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

你必須指定一種 flavor dimensions

void flavorDimensions(String... dimensions) 

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

flavorDimensions "api", "mode" 

接下來的使用對應起來就好了:

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多渠道打包的方式

總結

以上所述是小編給大家介紹的Android studio 3.0上進行多渠道打包遇到的問題小結(超簡潔版),希望對大家有所幫助,如果大家有任何疑問請給我留言,小編會及時回復大家的。在此也非常感謝大家對億速云網站的支持!

向AI問一下細節

免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。

AI

商水县| 九龙城区| 南和县| 习水县| 武穴市| 绥宁县| 雷波县| 兴安县| 无极县| 杭锦后旗| 丰城市| 宁明县| 西乌| 阿克| 大竹县| 海口市| 苏尼特左旗| 湘乡市| 郁南县| 江阴市| 大洼县| 赞皇县| 莱西市| 静宁县| 开封县| 和顺县| 罗定市| 石嘴山市| 峨眉山市| 临西县| 交口县| 台前县| 阳西县| 千阳县| 突泉县| 黑河市| 偃师市| 尼玛县| 墨竹工卡县| 东乡县| 桃源县|