构建后,APK大小增加,APK大小从3 mb增加到20 mb。
归因于lib,如圆圈所示。
如何删除这些lib文件?
https://i.stack.imgur.com/6ZCp5.png
apply plugin: 'com.android.application'
android {
compileSdkVersion 27
defaultConfig {
applicationId "csdevbin.dua"
minSdkVersion 15
targetSdkVersion 27
versionCode 6
versionName "4.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
debuggable false
minifyEnabled true
shrinkResources true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
debug {
debuggable true
minifyEnabled true
shrinkResources true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
我的依赖
implementation 'com.android.support:appcompat-v7:27.0.2'
implementation 'com.android.support:design:27.0.2'
implementation 'com.google.android.gms:play-services-ads:11.0.2'
implementation 'com.android.support.constraint:constraint-layout:1.0.0-beta4'
testCompile 'junit:junit:4.12'
implementation 'com.google.firebase:firebase-core:11.0.2'
implementation 'com.startapp:inapp-sdk:3.6.7'
implementation 'com.github.barteksc:android-pdf-viewer:2.8.1'
implementation 'com.android.support:cardview-v7:27.0.2'
最佳答案
我用过{com.github.barteksc:android-pdf-viewer:2.8.1'}
该库使用本机代码来呈现PDF。该库的文档具有a FAQ with a question specifically about your concern。