I have several libraries in my project, for example
dependencies { compile files('libs/universalloaderlibrary.jar') compile fileTree(dir: 'libs', include: ['*.jar']) compile 'com.android.support:appcompat-v7:22.2.1' compile 'com.android.support:design:22.2.1' compile 'com.android.support:recyclerview-v7:22.2.1' compile 'com.android.support:cardview-v7:22.2.1' compile 'de.hdodenhof:circleimageview:1.3.0' compile 'com.jakewharton:butterknife:7.0.1' //noinspection GradleCompatible compile 'com.google.android.gms:play-services-gcm:7.3.0' compile 'com.github.castorflex.smoothprogressbar:library:1.1.0' compile 'com.google.code.gson:gson:2.2.4' compile 'com.loopj.android:android-async-http:1.4.8' compile 'com.android.support:multidex:1.0.1' }
and other libraries. They increase the size of the application too much. In my project I have more than 25 libraries. Now the size of the APK is 11 MB, and I have to add more functionality to it. What could be the reason?
I have some questions regarding this.
What takes up more memory?
- The module is added to the project.
- The file is added as a JAR file.
- Gradle A dependency that we add in the same way as
compile 'com.android.support:appcompat-v7:22.2.1' .
I read that by enabling Proguard , setting minifyEnabled true can reduce the size of the application.
buildTypes { release { minifyEnabled true shrinkResources true proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' } }
How do they work behind the picture?
Should you avoid using multiple libraries in a project?
In my opinion, I have a lot of questions to reduce the size of the APK. Any suggestion and help will be noticeable. Thanks at Advance.
source share