Can't find the class com.google.android.gms.location.LocationClient (android)

后端 未结 11 1720
离开以前
离开以前 2020-12-15 16:03

I have download a demo project from http://developer.android.com/training/location/retrieve-current.html, and I think I don\'t lost any steps; But I can\'t find which jar fi

相关标签:
11条回答
  • 2020-12-15 16:50

    Jeremie Petitjean's solution worked for me. Go into youbuild.grade file and configure your app for a lower version. This is what I used and it works now:

    apply plugin: 'com.android.application'   
    android {
        compileSdkVersion 19
        buildToolsVersion "19.1.0"
    
    defaultConfig {
        applicationId "<APPLICATION NAME>"
        minSdkVersion 9
        targetSdkVersion 19
        versionCode 1
        versionName "1.0"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
            }
        }
    }
    
    dependencies {
        compile fileTree(dir: 'libs', include: ['*.jar'])
        compile 'com.android.support:support-v4:19.1.0'
        compile 'com.android.support:appcompat-v7:19.0.1'
        compile 'com.google.android.gms:play-services:4.2+'
    }
    
    0 讨论(0)
  • 2020-12-15 16:54

    Update the Google Play library to the latest version using the Android SDK Manager. In addition, I had to remove the library manually and add it again to my project following these steps. Version 3.1.36 contains:

    enter image description here

    The location folder:

    enter image description here

    You might have to update the ADT/SDK as well.

    0 讨论(0)
  • 2020-12-15 16:55

    Add to Gradle file (x.y.z - actual version of Google Play Services):

    compile 'com.google.android.gms:play-services-location:x.y.z'
    
    0 讨论(0)
  • 2020-12-15 16:58

    add this to your project `

    implementation 'com.google.android.gms:play-services-location:16.0.0'//location services`
    
    0 讨论(0)
  • 2020-12-15 17:00

    Try this if you use Android Studio:

    Right click on your app folder -> Open Module Settings -> Dependencies -> Click on the plus button -> Choose library dependency -> Search for "play-services" -> Double click on the com.google.android.gms:play-services

    Press Ok and wait for Gradle to rebuild. If error occurs clean and rebuild your project. here

    0 讨论(0)
提交回复
热议问题