简体   繁体   中英

Pro Version app apk size is twice than free version app when download from Playstore

My Application has two versions of flavors. FREE and PRO. When i generate sind apks, they are both the same size. But when i download them from google play pro version is twice bigger.

Here is my gradle code. If you need anything else to help i will provide.

    buildscript {
    repositories {
        maven { url 'https://maven.fabric.io/public' }
    }

    dependencies {
        classpath 'io.fabric.tools:gradle:1.+'
    }
}
apply plugin: 'com.android.application'
apply plugin: 'io.fabric'

repositories {
    maven { url 'https://maven.fabric.io/public' }
}

apply plugin: 'me.tatarka.retrolambda'

ext.googleSdkVersion = '10.2.1'
ext.supportLibraryVersion = '25.3.1'

android {
    signingConfigs {
        sign_config {
            keyAlias 'somealias'
            keyPassword 'somepass'
            storeFile file('../somekeystore.jks')
            storePassword 'somepass'
        }
    }
    lintOptions {
        disable 'MissingTranslation'
    }
    dexOptions {
        javaMaxHeapSize "4g"
    }
    compileSdkVersion 25
    buildToolsVersion "25.0.2"

    defaultConfig {
        multiDexEnabled true
        minSdkVersion 21
        targetSdkVersion 23
        versionCode 35
        versionName "2.0.3"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
            signingConfig signingConfigs.sign_config
        }
        debug {
            signingConfig signingConfigs.sign_config
        }
    }
    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }
    productFlavors {
        free {
            applicationId 'com.my.app'
        }
        pro {
            applicationId 'com.my.apppro'
        }
    }
}

dependencies {
    compile fileTree(include: ['*.jar'], dir: 'libs')
//    compile "com.android.support:design:$supportLibraryVersion"
    compile "com.android.support:design:$supportLibraryVersion"
    compile "com.google.firebase:firebase-core:$googleSdkVersion"
    compile "com.google.firebase:firebase-crash:$googleSdkVersion"
    compile "com.google.android.gms:play-services-ads:$googleSdkVersion"
    compile project(':trimming_helper')

    compile 'com.j256.ormlite:ormlite-core:4.48'
    compile 'com.j256.ormlite:ormlite-android:4.48'
    // for settings help activity
    compile 'com.github.chrisbanes:PhotoView:1.3.0'

    compile 'io.reactivex:rxandroid:1.2.1'
    compile 'io.reactivex:rxjava:1.1.6'
    compile 'com.facebook.android:facebook-android-sdk:4.18.0'
    compile 'com.afollestad:drag-select-recyclerview:0.4.0'
    compile 'org.greenrobot:eventbus:3.0.0'
    compile 'com.ogaclejapan.smarttablayout:library:1.6.1@aar'
    compile 'com.ogaclejapan.smarttablayout:utils-v4:1.6.1@aar'
    testCompile 'junit:junit:4.12'
    compile('com.crashlytics.sdk.android:crashlytics:2.6.7@aar') {
        transitive = true;
    }
    compile('com.crashlytics.sdk.android:crashlytics-ndk:1.1.6@aar') {
        transitive = true;
    }

    // pin Activity
    compile 'com.github.traex.rippleeffect:ripple:1.3.1-OG'
    compile 'com.github.omadahealth.typefaceview:typefaceview:1.5.0@aar' //TypefaceTextView
    compile 'uk.me.lewisdeane.ldialogs:ldialogs:1.2.0@aar'

    //Compat
    compile "com.android.support:support-v4:$supportLibraryVersion"
    compile "com.android.support:appcompat-v7:$supportLibraryVersion"
    compile "com.android.support:support-v13:$supportLibraryVersion"
    compile 'de.hdodenhof:circleimageview:2.1.0'
    compile 'com.squareup.picasso:picasso:2.5.2'
    compile 'com.intuit.sdp:sdp-android:1.0.4'

    // this for update all support version to last
    compile "com.android.support:cardview-v7:$supportLibraryVersion"
    compile "com.android.support:customtabs:$supportLibraryVersion"
}

apply plugin: 'com.google.gms.google-services'
crashlytics {
    enableNdk true
    androidNdkOut 'src/main/obj'
    androidNdkLibsOut 'src/main/libs'
}

I solve the problem , when i upload new apk to google play , there was a check box , for adding obb file (file size was 12 mb) , you can just uncheck and upload apk . that`s it )) Thank you Azizbekian for such a quick reply.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM