简体   繁体   中英

My Android app takes a long time to load the first time I open it

I have attached all the gradle dependencies of my app (which I think are the reason the app slows down).

Kindly tell me if any of the dependencies can be replaced with more specific ones or if they can be avoided all together.

Also I know that my app does slow down a bit due to enabling multi dex support but I had to enable it as my app was crashing when I had it disabled.

    apply plugin: 'com.android.application'

android {
    compileSdkVersion 25
    buildToolsVersion "24.0.1"

    defaultConfig {
        applicationId "com.neeraj8le.srmfoodies"
        minSdkVersion 15
        targetSdkVersion 25
        versionCode 1
        versionName "1.0"
        multiDexEnabled true
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }

    dexOptions {
        javaMaxHeapSize "4g"
    }

}

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    compile 'com.android.support:appcompat-v7:25.1.1'
    compile 'com.android.support:design:25.1.1'
    compile 'com.android.support:support-v4:25.1.1'
    compile 'com.android.support:recyclerview-v7:25.1.1'
    compile 'com.android.support:cardview-v7:25.1.1'
    compile 'com.squareup.picasso:picasso:2.5.2'
    compile 'com.google.android.gms:play-services-maps:10.0.1'
    compile 'com.android.support.constraint:constraint-layout:1.0.0-beta4'
    compile 'com.android.support:multidex:1.0.1'
    compile 'com.google.firebase:firebase-database:10.0.1'
    compile 'com.google.firebase:firebase-auth:10.0.1'
    testCompile 'junit:junit:4.12'
}

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

No need to replace or edit any gradle build link, It taking load when User first time app is installed. This is happening in all type of Applications like Whatsapp, Linkedin, etc. So Don't worry.

No need to replace or edit any gradle build link, It taking load when User first time app is installed. This is happening in all type of Applications like Whatsapp, Linkedin, etc. So Don't worry.

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