项目中添加了libsupportjni.so文件

时间:2018-12-19 12:16:37

标签: android android-studio android-ndk

随着我的应用程序即将完成,我正在使用Android Studio分析我的apk。我看到APK大小突然增加:

APK Analyzer. lib folder 43.4%, res folder 32.2%, classes.dex 20.4%

lib文件夹占用10mb的空间,仅包含以下文件:

libsupportjni.so for various CPU architectures

我确定我没有任何本地依赖性,但是我不确定这些文件是怎么来的。谁能帮我,我想从应用程序中删除这些文件。

编辑1

dependencies {
    implementation 'com.android.support.constraint:constraint-layout:1.1.2'
    implementation 'com.android.support:support-v4:28.0.0'
    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'com.android.support.test:runner:1.0.2'
    androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
    implementation fileTree(include: ['*.jar'], dir: 'libs')
    implementation 'com.android.support:design:28.0.0'
    implementation 'com.android.support:appcompat-v7:28.0.0'
    implementation 'com.android.support:cardview-v7:28.0.0'
    implementation 'de.hdodenhof:circleimageview:2.2.0'
    implementation 'com.intuit.sdp:sdp-android:1.0.5'
    implementation 'com.intuit.ssp:ssp-android:1.0.5'
    implementation 'com.google.android.gms:play-services-safetynet:15.0.1'
    implementation 'com.squareup.retrofit2:retrofit:2.4.0'
    implementation 'com.squareup.retrofit2:converter-scalars:2.4.0'
    implementation 'com.squareup.retrofit2:adapter-rxjava2:2.4.0'
    implementation 'com.squareup.retrofit2:converter-jackson:2.4.0'
    implementation 'io.reactivex.rxjava2:rxjava:2.2.2'
    implementation 'io.reactivex.rxjava2:rxandroid:2.1.0'
    implementation 'com.koushikdutta.ion:ion:2.2.1'
    //implementation 'com.facebook.shimmer:shimmer:0.3.0'
    //implementation 'com.facebook.android:facebook-login:[4,5)'
    implementation 'it.sephiroth.android.library.targettooltip:target-tooltip-library:+'
    implementation 'com.tbuonomo.andrui:viewpagerdotsindicator:2.1.2'
    implementation 'com.android.support:multidex:1.0.3'
    //Needed for custom web view implementation
    implementation 'com.android.support:customtabs:28.0.0'

}

2 个答案:

答案 0 :(得分:5)

取消选中

中的启用高级配置选项

运行-> 编辑配置-> 分析-> 启用高级分析

enter image description here

如果您只想排除 .so 文件,可以在android {}的{​​{1}}内部尝试以下操作

app/build.gradle

答案 1 :(得分:0)

添加到@Shizhen的答案中,在禁用“高级分析”后,我尝试执行 Build> Clean Project ,然后进行 Build> Rebuild Project ,这大大减小了apk的大小。< / p>