Firebase远程配置NullPointer

时间:2016-09-04 09:00:21

标签: android firebase firebase-remote-config

我收到以下错误:

09-04 10:45:50.429 4841-4869 E/AndroidRuntime: FATAL EXCEPTION: AsyncTask #3
    Process: com.xxx.xxx, PID: 4841
       java.lang.NullPointerException: Attempt to invoke interface method 'java.util.Set java.util.Map.keySet()' on a null object reference
           at com.google.android.gms.internal.zzalt.zza(Unknown Source)
           at com.google.android.gms.internal.zzalt.run(Unknown Source)
           at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:234)
           at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1113)
           at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:588)
           at java.lang.Thread.run(Thread.java:818)

当我在项目代码示例中解释时,我添加了远程配置firebase代码时,此错误仅提供给我。

这是我的傻瓜:

apply plugin: 'com.android.application'

android {
    compileSdkVersion "Google Inc.:Google APIs:23"
    buildToolsVersion "23.0.3"
    useLibrary  'org.apache.http.legacy'

    defaultConfig {
        applicationId "com.batriks.getblue"
        minSdkVersion 15
        targetSdkVersion 20
    }

    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
        }
    }
}

dependencies {
    compile project(':slidingMenu')
    compile project(':flip3DViewTransition')
    compile project(':facebookSDK')
    compile files('libs/universal-image-loader-1.9.2.jar')
    compile 'com.google.android.gms:play-services-location:9.4.0'
    compile 'com.google.android.gms:play-services:9.4.0'
//    compile 'com.google.android.gms:play-services-ads:9.2.0'
    compile 'com.google.firebase:firebase-core:9.0.2'
    compile 'com.google.firebase:firebase-config:9.0.2'
    compile 'com.android.support:support-v4:23.0.1'
    compile 'com.android.support:appcompat-v7:23.0.1'
    //compile 'com.google.android.gms:play-services:7.8.0'
}

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

顶级gradle:

// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
    repositories {
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:2.1.3'
        classpath 'com.google.gms:google-services:3.0.0'
    }
}

allprojects {
    repositories {
        jcenter()
    }
}

我也添加了google-services.json,并证明了几个libs配置,但似乎没有任何工作。

我该如何解决这个问题?

0 个答案:

没有答案