【问题标题】:Why FirebaseApp initialization is very slow,How to reduce app start time为什么FirebaseApp初始化很慢,如何减少app启动时间
【发布时间】:2016-10-20 06:13:30
【问题描述】:

我正在制作一个 android 应用程序,之前我使用 gcm 进行推送通知,现在我正在尝试使用 firebase 云消息传递来发送推送通知。我已经在我的应用程序中实现了 firebase 云消息传递功能,它运行良好,但问题是它应用第一次启动时间太长,请帮助我

build.gradle

apply plugin: 'com.android.application'

android {
    compileSdkVersion 23
    buildToolsVersion "23.0.2"

    defaultConfig {
        applicationId "com.next.fcm"
        minSdkVersion 15
        targetSdkVersion 23
        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:23.4.0'
    compile 'com.android.support:design:23.4.0'

    compile 'com.google.firebase:firebase-messaging:9.0.0'

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

【问题讨论】:

    标签: android firebase-cloud-messaging


    【解决方案1】:

    不要编译整个 fcm 库,只编译下面的行。

    compile "com.google.firebase:firebase-messaging:9.0.0"
    

    【讨论】:

    猜你喜欢
    • 2016-10-18
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-09-28
    • 2022-06-15
    • 2020-05-31
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多