Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Error: package com.google.android.gms.appstate does not exist

Can't compile my android project because of this error.

/BaseGameUtils/src/main/java/com/google/example/games/basegameutils/GameHelper.java
Error:(32, 39) error: package com.google.android.gms.appstate does not exist
Error:(293, 28) error: cannot find symbol variable AppStateManager
Error:(294, 30) error: cannot find symbol variable AppStateManager
Error:Execution failed for task ':BaseGameUtils:compileReleaseJava'.

Compilation failed; see the compiler error output for details. Information:BUILD FAILED

My gradle..

apply plugin: 
'android-library' repositories 
{ 
   mavenCentral() 
} 
buildscript 
{ 
  repositories
  {
     mavenCentral()
  }
  dependencies
  { 
     classpath 'com.android.tools.build:gradle:1.0.0'
  }
}
dependencies
{ 
    compile 'com.android.support:appcompat-v7:20.0.+' 
    compile 'com.android.support:support-v4:20.0.+' 
    compile 'com.google.android.gms:play-services:+' 
} 
android 
{ 
   compileSdkVersion 21 
   buildToolsVersion '21.0.0' 
   defaultConfig 
   { 
      minSdkVersion 14 
      targetSdkVersion 23 
   } 
   productFlavors { } 
}
like image 232
Sahil Mathew Avatar asked Oct 08 '15 11:10

Sahil Mathew


1 Answers

I see that you have not specified the goggle play services library.

Instead of this

compile 'com.google.android.gms:play-services:+'

Try this

compile 'com.google.android.gms:play-services:7.8.0'

Note: You might have a different version so instead of 7.8 enter that.

like image 79
varunkr Avatar answered Sep 22 '22 02:09

varunkr