Firebase Remote Config NullPointer

主宰稳场 提交于 2019-12-07 07:04:58

问题


I'm getting the following error:

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)

This error only gives me when I added Remote Config firebase code as they explain in the project code example.

This is my gradle:

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'

Top level 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()
    }
}

I have added google-services.json also, and proved several libs configs but nothing appears to work.

How can I solve this problem?

来源:https://stackoverflow.com/questions/39315234/firebase-remote-config-nullpointer

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!