app下的build.grdle里添加,注意在 android 里面 ,和defaultConfig 平级
productFlavors {
site {
dimension "api"
applicationId "xxx.xxxxx.xx"
manifestPlaceholders = [
UMENG_CHANNEL_VALUE: "site"
, APP_NAME: "驾"
,APP_ICON:"@mipmap/ic_launcher"
,AMAP_API_KEY:"高德key"]
}
c{
applicationId "xxx.xxx.xxx"
manifestPlaceholders = [
UMENG_CHANNEL_VALUE: "site"
,APP_NAME: "驾"
,APP_ICON:"@mipmap/ic_launcher"
,AMAP_API_KEY:"高德key"]
}
}
在manifest.xml里面 引用
${APP_ICON}
${applicationId}
7.0以上存储适配
<provider
android:name="android.support.v4.content.FileProvider"
android:authorities="${applicationId}.fileprovider"
android:exported="false"
android:grantUriPermissions="true">
<meta-data
android:name="android.support.FILE_PROVIDER_PATHS"
android:resource="@xml/filepaths" />
</provider>
网友评论