Search code examples
javaandroidandroid-studiogoogle-analyticslibgdx

Cannot resolve symbol 'android' - While implementing Google Analytics in Android App with libgdx


I am trying to follow this tutorial and import the analytics tracker. I have spend hours, but still no luck.

enter image description here

I keep getting the following error:

Cannot resolve symbol 'android'

This is where I have put my classpath line in my Project build.grade:

buildscript {
    repositories {
        mavenCentral()
        maven { url "https://oss.sonatype.org/content/repositories/snapshots/" }
        jcenter()
    }
    dependencies {
        classpath 'de.richsource.gradle.plugins:gwt-gradle-plugin:0.6'
        classpath 'com.android.tools.build:gradle:1.2.3'
        classpath 'org.robovm:robovm-gradle-plugin:1.9.0'
        classpath 'com.google.gms:google-services:1.5.0-beta2' // <-- HERE
    }
}

I have added these lines to my Android Module Gradle:

android {
    apply plugin: 'com.google.gms.google-services' // <-- HERE

and:

dependencies {
    compile 'com.google.android.gms:play-services-analytics:8.3.0' // <-- HERE
}

What am I doing wrong? Please help.

P.S.: It works in the Analytics sample.


Solution

  • Finally found the problem!

    I needed to do a Clean build and Rebuild. That was all!