2017-09-21 2 views
1

Meine 3MB App (verwendet proguard, um Größe zu reduzieren) auf Play-Store
aber nach der Installation wird es 22MB.
Ich möchte diese 22MB Größe am Telefon auf irgendwo 8 bis 10MB reduzierenGibt es eine Möglichkeit zu überprüfen, welcher Teil nach der Installation am meisten expandiert?

Jeder weiß jedes Werkzeug, das sagen wird, wer die größte Größe nach der Installation nimmt ?? damit ich diesen Teil der App reduzieren oder diese Funktionen aus der App entfernen kann.


unten ist highligted Teil, für die i Verteilung sehen
enter image description here

auf @Ankita Anfrage

apply plugin: 'com.android.application' 
apply plugin: 'io.fabric' 

signingConfigs { 
    release_config { 
     keyAlias 'XXXX' 
     keyPassword 'XXXX' 
     storeFile file('F:\\key.jks') 

     storePassword 'XXXX' 
    } 
} 

compileSdkVersion 25 
buildToolsVersion '26' 

defaultConfig { 
    applicationId "in.workindia.nileshdungarwal.workindiaandroid" 
    minSdkVersion 15 
    targetSdkVersion 22 

    versionCode 138 
    versionName "3.9.3.1" 

    resConfigs "en", "hi" 
    //testApplicationId 'in.workindia.nileshdungarwal.workindiaandroid.test' 
} 

buildTypes { 
    release { 

     //versionNameSuffix "-DEV-TEST" 
     //applicationIdSuffix ".test" 
     debuggable false 
     shrinkResources true 
     minifyEnabled true 

     proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' 
     signingConfig signingConfigs.release_config 
    } 

    debug { 
     useProguard false 
     versionNameSuffix "-DEBUG" 
     applicationIdSuffix ".debug" 

     /*Disable the fabric for debug version and do not update*/ 
     ext.alwaysUpdateBuildId = false 
    } 

} 

dexOptions { 
    javaMaxHeapSize "4g" 
    jumboMode true 
} 

buildTypes.debug { 
    it.buildConfigField 'String', 'BASE_URLS', DEBUG_URLS 

    it.buildConfigField 'Boolean', 'BRANCH_IO_MODE_IS_LIVE', BRANCH_IO_MODE_DEBUG 

    it.buildConfigField 'String', 'OFFICE_CONTACT_NO', OFFICE_CONTACT_NO 

    it.buildConfigField 'String', 'CLIENT_ID', SERVER_DEBUG_CLIENT_ID 
    it.buildConfigField 'String', 'SECRET_KEYS', SERVER_DEBUG_CLIENT_SECRET 

    it.buildConfigField 'String', 'GOOGLE_GEOLOCATION_API_KEY', GOOGLE_DEBUG_GEOLOCATION_API_KEY 
    it.buildConfigField 'String', 'TAG_MANAGER_CONTANER_ID', DEBUG_TAG_MANAGER_CONTANER_ID 

    it.buildConfigField 'String', 'MQTT_BROKER_USERNAME', MQTT_BROKER_USERNAME 
    it.buildConfigField 'String', 'MQTT_BROKER_PASSWORD', MQTT_BROKER_PASSWORD 

    it.buildConfigField 'String', 'POLE_API_KEY', POLE_API_KEY 
} 

buildTypes.release { 
    it.buildConfigField 'String', 'BASE_URLS', BASE_URLS 

    it.buildConfigField 'Boolean', 'BRANCH_IO_MODE_IS_LIVE', BRANCH_IO_MODE_LIVE 

    it.buildConfigField 'String', 'OFFICE_CONTACT_NO', OFFICE_CONTACT_NO 

    it.buildConfigField 'String', 'CLIENT_ID', SERVER_RELEASE_CLIENT_ID 
    it.buildConfigField 'String', 'SECRET_KEYS', SERVER_RELEASE_CLIENT_SECRET 

    it.buildConfigField 'String', 'GOOGLE_GEOLOCATION_API_KEY', GOOGLE_RELEASE_GEOLOCATION_API_KEY 
    it.buildConfigField 'String', 'TAG_MANAGER_CONTANER_ID', RELEASE_TAG_MANAGER_CONTANER_ID 

    it.buildConfigField 'String', 'MQTT_BROKER_USERNAME', MQTT_BROKER_USERNAME 
    it.buildConfigField 'String', 'MQTT_BROKER_PASSWORD', MQTT_BROKER_PASSWORD 

    it.buildConfigField 'String', 'POLE_API_KEY', POLE_API_KEY 
} 

packagingOptions { 
    exclude 'META-INF/DEPENDENCIES' 
    exclude 'META-INF/NOTICE' 
    exclude 'META-INF/LICENSE' 
    exclude 'META-INF/LICENSE.txt' 
    exclude 'META-INF/NOTICE.txt' 
} 
} 
      afterEvaluate { 
      // processDebugGoogleServices.dependsOn switchToDebug 
       processReleaseGoogleServices.dependsOn switchToRelease 
      } 

      task printDependencies << { 
       configurations.compile.each { println it.name } 
      } 

      task switchToDebug(type: Copy) { 
       description = 'Switches to DEBUG google-services.json' 
       from "src/debug_work" 
       include "google-services.json" 
       into "." 
      } 

      task switchToRelease(type: Copy) { 
       description = 'Switches to RELEASE google-services.json' 
       from "src/release_work" 
       include "google-services.json" 
       into "." 
      } 

      dependencies { 
       compile fileTree(include: ['*.jar'], dir: 'libs') 
       compile('com.crashlytics.sdk.android:crashlytics:[email protected]') { 
        transitive = true; 
       } 
       compile('org.eclipse.paho:org.eclipse.paho.android.service:1.1.1') { 
        exclude module: 'support-v4' 
        transitive = true 
       } 
       compile files('libs/GoogleConversionTrackingSdk-2.2.4.jar') 
       compile 'me.pushy:sdk:1.0.26' 
       compile 'io.branch.sdk.android:library:2.+' 
       compile 'com.facebook.android:facebook-android-sdk:4.19.0' 
       compile 'com.google.android.gms:play-services-location:9.6.1' 
       compile 'com.google.android.gms:play-services-analytics:9.6.1' 
       compile 'com.google.android.gms:play-services-gcm:9.6.1' 
       compile 'com.android.support:design:25.0.0' 
       compile 'com.android.support:cardview-v7:25.0.0' 
       compile 'com.android.support:appcompat-v7:25.0.0' 
       compile 'com.android.support:recyclerview-v7:25.0.0' 
       compile 'com.fasterxml.jackson.core:jackson-core:2.7.3' 
       compile 'com.fasterxml.jackson.core:jackson-annotations:2.7.3' 
       compile 'com.fasterxml.jackson.core:jackson-databind:2.7.3' 
       compile 'com.mixpanel.android:mixpanel-android:5.+' 
       compile 'com.squareup.retrofit2:retrofit:2.1.0' 
       compile 'com.squareup.retrofit2:converter-jackson:2.1.0' 
       compile 'com.edmodo:cropper:1.0.1' 
       compile 'com.edmodo:rangebar:1.0.0' 
       compile 'com.squareup.picasso:picasso:2.5.2' 
      } 

      apply plugin: 'com.google.gms.google-services' 
+0

zeigen Sie Ihre Gradle-Datei an. – Ankita

+0

@Ankita Proguard ist richtig angewendet, zuvor war meine App 5MB jetzt ist es 3,3 MB, also kein Problem mit Progaurd, aber immer noch, wenn Sie wollen, auf jeden Fall kann ich –

+0

post ja ich will sehen. – Ankita

Antwort

1

Ich persönlich würde sagen, dass Verwenden ProGuard

wollen ProGuard wird das unbenutzte Ja entfernen va Code. Es hilft erheblich den Code Foot Prints zu reduzieren. ProGuard ist der beliebteste Optimierer für Java-Bytecode. Es macht Ihre Java- und Android-Anwendungen um bis zu 90% kleiner und bis zu 20% schneller. ProGuard bietet auch minimalen Schutz gegen Reverse Engineering durch Verschleiern der Namen von Klassen, Feldern und Methoden.

Lesen Sie die offizielle Richtlinie über Reduce APK Size.

+1

Wirklich hilfreicher Link und Werkzeug ist es. – Ankita

+0

@Ankita Ja, ist es. –

+0

@IntelliJAmiya Meine Frage ist "Wer nimmt die maximale Größe am Telefon nach der Installation"? –

Verwandte Themen