其他分享
首页 > 其他分享> > Android开发 build.gradle的使用记录

Android开发 build.gradle的使用记录

作者:互联网

将打包apk重命名

android {
    
    //命令打包apk重命名
    android.applicationVariants.all { variant ->
        variant.outputs.all {
            outputFileName = "YT-${variant.name}-${variant.versionName}.apk"
        }
    }
}

manifestPlaceholders妙用

https://www.cnblogs.com/zhaohongtian/p/6808962.html 参考

       String jpush_appkey;
        try {
            ApplicationInfo appInfo = getPackageManager()
                    .getApplicationInfo(getPackageName(),
                            PackageManager.GET_META_DATA);

            jpush_appkey = appInfo.metaData.getString("JPUSH_APPKEY");

            Logger.d("jpush_appkey=" + jpush_appkey);
        } catch (PackageManager.NameNotFoundException e) {
            e.printStackTrace();

        }

 

 

end

标签:appkey,appInfo,jpush,variant,gradle,apk,build,Android,android
来源: https://www.cnblogs.com/guanxinjing/p/14821479.html