Add Google Analytics to Android project - Error: Unable to load class 'com.google.gson.JsonObject'

允我心安 提交于 2019-12-12 01:07:49

问题


I followed this link to add Analytics to my project: https://developers.google.com/analytics/devguides/collection/android/v4/

This is my project level build.gradle:

buildscript {
    repositories {
        jcenter()
    }
    dependencies {
        classpath 'com.google.gms:google-services:3.0.0'

    }
}

and this is my module build.gradle (I put the plugin at the bottom of the file):

dependencies {
    compile 'com.google.android.gms:play-services-analytics:9.2.0'
    compile 'com.android.support:support-v4:18.0.0'
    compile 'com.android.support:appcompat-v7:18.0.0'
    compile 'org.quanqi:android-view-pager-indicator:0.9.0'
    compile 'com.android.support:recyclerview-v7:+'
    compile 'com.makeramen:roundedimageview:2.2.1'
    compile 'com.github.bumptech.glide:glide:3.6.1'
}

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

I followed the link step by step but I got this error:

(I'm using gralde plugin v 2.10)

What is wrong?!!!

来源:https://stackoverflow.com/questions/38420409/add-google-analytics-to-android-project-error-unable-to-load-class-com-googl

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