Google Analytics(分析)编译错误执行失败,因为任务':app:processDebugGoogleServices?

时间:2016-04-22 21:01:02

标签: android google-analytics google-analytics-v4 google-analytics-sdk google-analytics-android

我从以下网站下载并编译了分析示例应用程序:

https://developers.google.com/analytics/devguides/collection/android/v4/start

我将配置文件下载并保存到:

app\google-services.json

当我建立时,我得到:

Error:Execution failed for task ':app:processDebugGoogleServices'.
> No matching client found for package name
  'com.google.samples.quickstart.analytics'

文件:build.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.0.0'
        classpath 'com.google.gms:google-services:2.0.0'

        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

allprojects {
    repositories {
        jcenter()
    }
}

文件:build.gradle(模块:应用)

apply plugin: 'com.android.application'

android {
    compileSdkVersion 23
    buildToolsVersion "23.0.2"

    defaultConfig {
        applicationId "com.google.samples.quickstart.analytics"
        minSdkVersion 14
        targetSdkVersion 23
        versionCode 1
        versionName "1.0"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt')
        }
    }
}

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    compile 'com.android.support:appcompat-v7:23.2.0'
    compile 'com.android.support:support-v4:23.2.0'


    // [START gms_compile]
    compile 'com.google.android.gms:play-services-analytics:8.4.0'
    // [END gms_compile]
}

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

我错过了什么?

我的目标是运行示例应用,并在Android应用中采取措施时,在Google Analytics网站上看到一些活动。

提前致谢,

0 个答案:

没有答案