Defining Product Flavours & Signing Config as below in the module build.gradle file and then clicking the Run button (betaRelease Config)
android { signingConfigs { my_alias { keyAlias 'my_alias' keyPassword '*******' storeFile file('*******') storePassword '******' } } compileSdkVersion 23 buildToolsVersion "23.0.3" defaultConfig { minSdkVersion 16 targetSdkVersion 22 versionCode 9 versionName "0.2" resConfigs "en","hi","te" multiDexEnabled true } buildTypes { release { minifyEnabled true shrinkResources true proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' signingConfig signingConfigs.my_alias } debug { minifyEnabled false } } productFlavors { alpha { applicationId = "***************" resValue 'string', 'app_name', '**********' resValue 'string', 'instabug_app_id','*******************' manifestPlaceholders = [onesignal_app_id : "*******************", onesignal_google_project_number: "************"] } beta { applicationId = "***************" resValue 'string', 'app_name', '**********' resValue 'string', 'instabug_app_id','*******************' manifestPlaceholders = [onesignal_app_id : "*******************", onesignal_google_project_number: "************"] } } aaptOptions { additionalParameters "--no-version-vectors" } }
Using the Generate Signed APK Option from the Build menu in Android Studio
第一个APK大小为14.5MB,而第二个APK大小为22.5MB,两者之间有很大的差异。通过使用APK分析器,我可以看到第二个APK在res文件夹中重复了drawable资源,如下所示。较小的发布APK(14.5MB)在各种设备上都能正常工作。
我需要更大的APK吗?我能上传普通的发布APK到Play商店吗?
是否有任何配置可以避免重复的drawable资源?