我开发的应用程序,包括下面的依赖如何降低的Android的.apk大小
模块级
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:23.3.0'
compile 'com.android.support:design:23.3.0'
compile 'com.google.android.gms:play-services:9.0.0' **// for GCM**
compile 'com.android.support:cardview-v7:23.3.0'
compile 'com.squareup.picasso:picasso:2.5.2' **//Rounding and displaying image from URL**
compile 'com.google.code.gson:gson:2.6.2'
compile 'com.github.lecho:hellocharts-library:[email protected]' **// For bar graph**
compile('com.crashlytics.sdk.android:crashlytics:[email protected]') {
transitive = true;
}
compile 'com.google.firebase:firebase-core:9.0.0' **// Analytics**
}
项目一级
dependencies {
classpath 'com.android.tools.build:gradle:2.1.2'
classpath 'com.google.gms:google-services:3.0.0'
classpath 'io.realm:realm-gradle-plugin:1.0.1' // Database
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
我
/Assets/150kb使用字体aweasome文件。
/JAVA - 644 KB
/RES - 740 KB(用于高分辨率图像1920 * 1280尺寸220KB压缩与tinypng)
已经施加ProGuard的。 删除未使用的文件和代码。
问题
不过我的应用程序大小为7.03MB
如何减少应用程序的大小?我不知道为什么这是7.03MB
是否有任何计算给出了apk中依赖关系所使用的大小?
像谷歌播放服务在apk中占用200kb左右。
您已经编译**所有** Google Play服务,而不仅仅是** GCM –
针对不同的处理器体系结构(如Armb,x86等)创建不同的版本,而不是通用apk文件。并按照以下文章https://medium.com/pregbuddy-engineering/how-we-reduced-our-android-app-size-by-65-54b17ae9a3c6#.eiqa5xsmh – HourGlass
请参阅https://developers.google。 com/android/guides/setup或使用FCM,因为您已经拥有Firebase Core –