2016-12-07 70 views
2

即時通訊使用的味道生成多個版本的相同的應用程序,其中唯一的變化是風格,但我需要上傳幾個apk的Playstore,但我有一個問題時嘗試生成該項目,標記「找不到匹配的客戶端的軟件包名稱」錯誤。沒有匹配的客戶端發現包名稱與味道

我的build.gradle文件是:

starwing { 
     applicationId "mx.com.locker.starwing" 
     versionCode 11 
     versionName "1.11" 
    } 
    puntoarq { 
     applicationId "mx.com.locker.starwing.puntoarq" 
     versionCode 1 
     versionName "1" 
    } 

的 「mx.com.locker.starwing.puntoarq」 是沒有找到一個。

回答

1

嘗試使用applicationIdSuffix像改變每個產品風味的應用程序ID:

android { 
    ... 
    defaultConfig { 
     applicationId "mx.com.locker" 
     ... 
    } 
    productFlavors { 
     starwing { 
      applicationIdSuffix ".starwing" 
      versionCode 11 
      versionName "1.11" 
     } 
     puntoarq { 
      applicationIdSuffix ".puntoarq" 
      versionCode 1 
      versionName "1" 
     } 
    } 
} 

並確保您有針對每種口味的res文件夾在各自的目錄是這樣的:

# common/default resources here 
app/src/main/res/values 
         \___ /styles.xml 
         |___ /colors.xml 
         \__ ... 

# starwing resources here 
app/src/starwing/res/values 
         \___ /styles.xml 
         |___ /colors.xml 
         \__ ... 

# puntoarq resources here 
app/src/puntoarq/res/values 
         \___ /styles.xml 
         |___ /colors.xml 
         \__ ... 

如果您使用的是某些Google服務,則源代碼文件和google-services.json也是如此。

# common/default resources here 
app/src/main/google-services.json 

# starwing resources here 
app/src/starwing/google-services.json 

# puntoarq resources here 
app/src/puntoarq/google-services.json 

你可以建立特定的香味從選擇的Android Studio中構建變量或運行./gradlew assembleStarwingRelease./gradlew assemblePuntoarqRelease

你可以看看here瞭解更多信息。

相關問題