1

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

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(模块:app)

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(分析)网站上。

提前致谢,

4

0 回答 0