美文网首页
Android 多渠道,多包名,多app名,多资源,多FileP

Android 多渠道,多包名,多app名,多资源,多FileP

作者: yunhen | 来源:发表于2019-03-15 17:30 被阅读0次

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>

相关文章

网友评论

      本文标题:Android 多渠道,多包名,多app名,多资源,多FileP

      本文链接:https://www.haomeiwen.com/subject/dqurmqtx.html