【问题标题】:Installation file 4-5 times bigger than the APK file安装文件比APK文件大4-5倍
【发布时间】:2019-12-18 15:33:42
【问题描述】:

我的 APK 文件大小为 14mb。然而,在我的设备上安装该应用程序给了我 54mb 的巨大空间。

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

        release {
                minifyEnabled true
                proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
                shrinkResources true

        }
    }

我的依赖如下:

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 文件大 4-5 倍。

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

【问题讨论】:

  • 你试过在android studio中分析apk文件吗?它会告诉你什么是占用空间
  • 谢谢,但在我在这里发布我的问题之前,我已经使用了分析 APK 功能。以下是我的回答。

标签: android apk size filesize


【解决方案1】:

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

implementation 'com.google.firebase:firebase-inappmessaging-display:19.0.0'

自动将 20mb 添加到我的安装文件中。 我希望 Firebase 能就此发出一些警告。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2012-12-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-08-09
    • 2017-05-18
    • 1970-01-01
    • 2012-11-01
    相关资源
    最近更新 更多