项目中添加了libsupportjni.so文件 [英] libsupportjni.so files added in the project

查看:82
本文介绍了项目中添加了libsupportjni.so文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

As my application is approaching completion, I was analyzing my apk using Android Studio. I saw a sudden increase in apk size:

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

The lib folder which is occupying 10mb space has only these files:

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

I am sure that I don't have any native dependencies, but I am not sure how these files came here. Can anyone help me, I want to remove these files from my application.

编辑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'

}

推荐答案

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

Run -> Edit Configurations -> Profiling -> Enable advanced profiling.

如果您只想排除 .so 文件,可以在app/build.gradleandroid {}内尝试以下操作

If you simply want to exclude the .so files, can try below inside your android {} of app/build.gradle

android { 
    ...
    packagingOptions {
        exclude 'lib/x86/libsupportjni.so'
        exclude 'lib/x86_64/libsupportjni.so'
        exclude 'lib/armeabi-v7a/libsupportjni.so'
        exclude 'lib/arm64-v8a/libsupportjni.so'
    }
    ...
}

添加上一个答案后,可以在禁用高级探查器"后尝试构建>清理项目",然后尝试构建>重建".它还减小了apk大小.

Adding the the previous answer, you can try 'Build > Clean Project' and then 'Build > Rebuild' after disabling 'Advanced Profiler'. It also reduced apk size.

这篇关于项目中添加了libsupportjni.so文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆