I integrated the HockeySDK for Android following this tutorial: https://github.com/bitstadium/HockeySDK-Android#setup. In the default config of gradle set App ID set described in tutorial manifestPlaceholders = [HOCKEYAPP_APP_ID: "appID"]
For a single app it works fine but my project contains different product flavors and I need to use different App IDs for each flavor. Is it possible to use App ID from strings resources for appropriate target instead "appID" in gradle?
问问题
623 次
1 回答
1
您几乎自己回答了您的问题,您定义了不同的风格并定义了不同的清单占位符。下面的代码片段为内部和发布版本定义了两种风格,其中 HockeyApp appId 和 appSecret 具有不同的值。
productFlavors {
internal {
applicationId "YOUR_VALUE_HERE"
manifestPlaceholders = [HOCKEYAPP_APP_ID: "YOUR_VALUE_HERE", HOCKEYAPP_APP_SECRET: "YOUR_VALUE_HERE]
versionCode 1
//maybe some more stuff for your flavor
}
live {
applicationId "YOUR_VALUE_HERE"
manifestPlaceholders = [HOCKEYAPP_APP_ID: "YOUR_VALUE_HERE", HOCKEYAPP_APP_SECRET: "YOUR_VALUE_HERE]
versionCode 1
//maybe some more stuff for your flavor
}
}
于 2016-04-18T07:32:43.097 回答