我的游戏应用程序包括4个代表不同游戏板的大型PNG图像:
为了减少APK文件的大小,我遵循了
Build Multiple APKs
文档,并将以下部分添加到
应用程序/内部版本。格拉德尔
文件:
splits {
density {
enable true
reset()
include "mdpi", "hdpi", "xhdpi", "xxhdpi", "xxxhdpi"
}
}
之后,我选择
构建->生成已签名的APK。。。
在Android Studio菜单中。
令人惊讶的是,APK文件仍然具有相同的文件大小:
和
分析APK。。。
显示的资源
全部的
屏幕密度仍包括在内:
请问我在这里遗漏了什么,如何排除不必要的资源?
我的整个
应用程序/内部版本。格拉德尔
如下所示:
apply plugin: 'com.android.application'
android {
compileSdkVersion 26
buildToolsVersion '26.0.2'
defaultConfig {
resConfigs "en"
applicationId "com.example"
minSdkVersion 16
targetSdkVersion 26
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
splits {
density {
enable true
reset()
include "mdpi", "hdpi", "xhdpi", "xxhdpi", "xxxhdpi"
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
compile "com.android.support:appcompat-v7:$supportLibVersion"
compile "com.android.support:cardview-v7:$supportLibVersion"
compile "com.android.support:customtabs:$supportLibVersion"
compile "com.android.support:design:$supportLibVersion"
compile 'com.android.support.constraint:constraint-layout:1.0.2'
compile "com.google.android.gms:play-services-auth:$firebaseLibVersion"
compile "com.google.firebase:firebase-messaging:$firebaseLibVersion"
compile 'com.android.billingclient:billing:1.0'
compile 'com.github.bumptech.glide:glide:4.3.1'
compile 'com.neovisionaries:nv-websocket-client:2.3'
compile 'com.readystatesoftware.sqliteasset:sqliteassethelper:2.0.1'
compile 'com.facebook.android:facebook-android-sdk:4.28.0'
testCompile 'junit:junit:4.12'
}
allprojects {
repositories {
jcenter()
maven {
url "https://maven.google.com"
}
}
}
apply plugin: 'com.google.gms.google-services'