Issue
As my application is approaching completion, I was analyzing my apk using Android Studio. I saw a sudden increase in apk size:
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.
Edit 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'
}
Solution
Uncheck Enable advanced profiling option from
Run -> Edit Configurations -> Profiling -> Enable advanced profiling.
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'
}
...
}
Adding the the previous answer, you can try 'Build > Clean Project' and then 'Build > Rebuild' after disabling 'Advanced Profiler'. It also reduced apk size.
Answered By - shizhen
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.