Android 安装文件比APK文件大4-5倍
我有一个APK文件大小14mb。然而,在我的设备上安装这个应用程序给了我巨大的54mb空间Android 安装文件比APK文件大4-5倍,android,apk,size,filesize,Android,Apk,Size,Filesize,我有一个APK文件大小14mb。然而,在我的设备上安装这个应用程序给了我巨大的54mb空间 release { minifyEnabled true proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' shrinkResources true }
release {
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
shrinkResources true
}
}
我已经大大减少了我的res资产的大小(目前只有6MB)。
此外,我还在gradle文件中添加了以下行:
release {
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
shrinkResources true
}
}
我的依赖项如下:
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文件的两倍,或者在最坏的情况下是原来的三倍,但实际上并没有比原来的APK文件大4-5倍
release {
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
shrinkResources true
}
}
什么也会导致安装和APK大小的巨大差异?在分析了我的依赖关系后,我得出结论,启用此部件
release {
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
shrinkResources true
}
}
implementation 'com.google.firebase:firebase-inappmessaging-display:19.0.0'
自动将20mb添加到我的安装文件中。
我希望Firebase对此有一些警告。您是否尝试在android studio中分析apk文件?它将向您展示什么正在占用空间谢谢,但在这里发布我的问题之前,我已经使用了分析APK函数。下面是我的答案。
release {
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
shrinkResources true
}
}