Android 如何减小库文件夹的大小?

Android 如何减小库文件夹的大小?,android,android-support-library,lib,Android,Android Support Library,Lib,我的应用程序是当我使用按钮时打开pdf书,pdf文件的大小很小,只有1MB! 这是我的依赖项: dependencies { implementation fileTree(dir: 'libs', include: ['*.jar']) implementation 'com.android.support:appcompat-v7:27.1.1' implementation 'com.android.support.constraint:constraint-lay

我的应用程序是当我使用按钮时打开pdf书,pdf文件的大小很小,只有1MB! 这是我的依赖项:

dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    implementation 'com.android.support:appcompat-v7:27.1.1'
    implementation 'com.android.support.constraint:constraint-layout:1.1.0'
    implementation 'com.github.barteksc:android-pdf-viewer:2.8.2'
    implementation 'org.apache.commons:commons-io:1.3.2'
    implementation 'com.android.support:design:27.1.1'
    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'com.android.support.test:runner:1.0.1'
    androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1'
}
lib文件夹的大小为17MB

请看图片

为什么产生的apk如此之大? Android PdfViewer依赖于PdfiumAndroid,这是一组本地库,对于许多体系结构来说几乎为16MB。Apk必须包含所有这些库,才能在市场上可用的每个设备上运行。幸运的是,Google Play允许我们上传多个APK,例如,每个架构一个APK。这里有一篇关于自动将应用程序拆分为多个APK的好文章。最重要的部分是通过APK拆分改进多APK创建和版本代码处理,但整篇文章值得一读。您只需要在应用程序中执行此操作,不需要分叉PdfiumAndroid之类的东西


解决方案是分割APK。阅读此处的更多信息:

libs文件夹是否包含。文件在其中?请检查libs文件夹中的内容您是否正在使用。文件是在拆分apk后自动创建的。我应该选择哪一个!我不能全部上传不?