首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >安装文件比APK文件大4-5倍

安装文件比APK文件大4-5倍
EN

Stack Overflow用户
提问于 2019-12-18 23:33:42
回答 1查看 56关注 0票数 0

我有一个大小为14mb的APK文件。然而,在我的设备上安装应用程序会给我带来巨大的54mb。

我已经大幅减少了我的res资产的大小(目前只有6MB)。另外,我在gradle文件中添加了以下几行代码:

代码语言:javascript
复制
        release {
                minifyEnabled true
                proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
                shrinkResources true

        }
    }

我的依赖关系如下:

代码语言:javascript
复制
dependencies {


    implementation fileTree(include: ['*.jar'], dir: 'libs')
    implementation 'androidx.appcompat:appcompat:1.0.2'
    implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
    implementation 'com.google.android.material:material:1.0.0'
    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'androidx.test:runner:1.2.0'
    androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
    implementation 'androidx.gridlayout:gridlayout:1.0.0'
    implementation 'com.google.android:flexbox:1.0.0'
    implementation 'androidx.cardview:cardview:1.0.0'
    implementation 'com.github.hotchemi:android-rate:1.0.1'
    implementation 'com.google.firebase:firebase-core:17.0.0'
    implementation 'com.crashlytics.sdk.android:crashlytics:2.10.1'
    implementation 'com.google.firebase:firebase-auth:19.0.0'
    implementation 'com.firebaseui:firebase-ui-auth:4.2.0'
    implementation 'com.google.firebase:firebase-database:19.0.0'
    implementation 'com.anjlab.android.iab.v3:library:1.0.44'
    implementation 'com.google.android.gms:play-services-auth:17.0.0'
    implementation 'com.google.firebase:firebase-messaging:19.0.0'
    implementation 'com.google.firebase:firebase-inappmessaging-display:19.0.0'
    implementation 'com.facebook.android:facebook-android-sdk:[4,5)'
    implementation 'androidx.multidex:multidex:2.0.0'
    implementation 'com.google.firebase:firebase-config:19.0.0'
    implementation 'com.crashlytics.sdk.android:crashlytics:2.10.1'
    implementation 'com.squareup.picasso:picasso:2.5'
    implementation 'com.squareup.okhttp:okhttp:2.5.0'
    implementation 'com.github.hajiyevelnur92:intentanimation:1.0'
    implementation files('libs/YouTubeAndroidPlayerApi.jar')

我听说安装文件的大小可以是原来的APK文件大小的两倍,在最坏的情况下是三倍,但不会比原来的APK文件大4-5倍。

还有什么原因会导致安装和APK大小如此巨大的差异?

EN

回答 1

Stack Overflow用户

发布于 2019-12-19 05:54:26

在分析了我的依赖关系之后,我得出的结论是启用这一部分

代码语言:javascript
复制
implementation 'com.google.firebase:firebase-inappmessaging-display:19.0.0'

自动添加20mb到我的安装文件。我希望Firebase对此有一些警告。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/59395348

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档