Firebase - 错误出错:任务执行失败':app:processFacebookDebugGoogleServices'

时间:2016-07-02 15:31:50

标签: android android-studio firebase

我正在尝试使用google代码for quickstart使用所有登录方法使用firebase登录,但我在控制台中遇到以下错误。

  1. 错误
  2. 应用/摇篮
  3. 网络/摇篮
  4. Gradle Console错误

        Parsing json file: E:\Git\FireBase All\quickstart-android-master\auth\app\google-services.json
    :app:processFacebookDebugGoogleServices FAILED
    
    FAILURE: Build failed with an exception.
    
    * What went wrong:
    Execution failed for task ':app:processFacebookDebugGoogleServices'.
    > No matching client found for package name 'com.google.firebase.quickstart.auth'
    
    * Try:
    Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
    
    BUILD FAILED
    

    应用/摇篮

    apply plugin: 'com.android.application'
    
    android {
        compileSdkVersion 24
        buildToolsVersion "24.0.0"
    
        defaultConfig {
            applicationId "com.google.firebase.quickstart.auth"
            minSdkVersion 9
            targetSdkVersion 24
            versionCode 1
            versionName "1.0"
        }
    
        buildTypes {
            release {
                minifyEnabled true
                proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
            }
        }
    
        productFlavors {
    
            // Build variant to include the Facebook Android SDk
            // The Facebook Android SDK has a min SDK version of 15
            facebook {
                minSdkVersion 15
            }
    
            // Build variant to exclude the Facebook Android SDK
            // Firebase Authentication has a min SDK version of 9
            nofacebook {
                minSdkVersion 9
            }
    
        }
    }
    
    dependencies {
        compile 'com.android.support:appcompat-v7:24.0.0'
    
        // Firebase Authentication
        compile 'com.google.firebase:firebase-auth:9.2.0'
    
        // Google Sign In SDK (only required for Google Sign In)
        compile 'com.google.android.gms:play-services-auth:9.2.0'
    
        // Facebook Android SDK (only required for Facebook Login)
        // This is only compiled into the 'facebook' variant of this app. You can build
        // a 'nofacebook' variant to test on devices with SDK < 15.
        facebookCompile 'com.facebook.android:facebook-android-sdk:4.9.0'
    
        // Twitter Android SDK (only required for Twitter Login)
        compile('com.twitter.sdk.android:twitter-core:1.6.6@aar') {
            transitive = true
        }
        compile('com.twitter.sdk.android:twitter:1.13.1@aar') {
            transitive = true;
        }
    }
    
    apply plugin: 'com.google.gms.google-services'
    

    网络/摇篮

    // Top-level build file where you can add configuration options common to all sub-projects/modules.
    
    buildscript {
        repositories {
            jcenter()
            mavenLocal()
        }
        dependencies {
            classpath 'com.android.tools.build:gradle:2.1.2'
            classpath 'com.google.gms:google-services:3.0.0'
        }
    }
    
    allprojects {
        repositories {
            jcenter()
            maven { url 'https://maven.fabric.io/public' }
            mavenLocal()
        }
    }
    
    task clean(type: Delete) {
        delete rootProject.buildDir
    }
    

1 个答案:

答案 0 :(得分:1)

  1. 到你的app文件夹检查你是否有google-services.json
  2. 如果不存在,则需要从firebase下载
  3. 打开google-services.json,然后确保包名称如下"package_name": "com.google.firebase.quickstart.auth"