簡體   English   中英

我的 Android 應用程序在我第一次打開時需要很長時間才能加載

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

我已經附加了我的應用程序的所有 gradle 依賴項(我認為這是應用程序變慢的原因)。

請告訴我是否可以將任何依賴項替換為更具體的依賴項,或者是否可以一起避免它們。

另外我知道由於啟用了多 dex 支持,我的應用程序確實會變慢一點,但是我必須啟用它,因為當我禁用它時我的應用程序崩潰了。

    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'

無需替換或編輯任何gradle構建鏈接,在安裝“用戶首次安裝”應用程序時即會加載。 這在所有類型的應用程序中都在發生,例如Whatsapp,Linkedin等。因此,請不要擔心。

無需替換或編輯任何 gradle 構建鏈接,當用戶第一次安裝應用程序時它會加載。 這發生在所有類型的應用程序中,如 Whatsapp、Linkedin 等。所以不用擔心。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM