简体   繁体   中英

Android Studio gradle update error

I am working on geofencing app in Android. If I set the

  dependencies {
        compile fileTree(dir: 'libs', include: ['*.jar'])
        testCompile 'junit:junit:4.12'
        compile 'com.android.support:appcompat-v7:23.4.0'     
        compile 'com.google.android.gms:play-services-location:9.0.1'
    }

it works fine.If I changed it to

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    testCompile 'junit:junit:4.12'
    compile 'com.android.support:appcompat-v7:23.4.0'  
    compile 'com.google.android.gms:play-services-location:11.0.2'
}

I get following error.

package com.google.android.gms.maps does not exist
package com.google.android.gms.maps.model does not exist

Why? I need to set it to 11.0.2 for integrating it with other app.

Sync Project With Gradle File may help. Just click the button next to AVD Manager or navigate through Tools->Android->Sync Project With Gradle File .

尝试将您的项目与gradle文件同步,但是如果gradle同步失败,则下载gradle的最新版本,并在build.gradle下指定其路径,然后尝试再次同步。

you got to install the missing google play services. Go to settings and update your google play services and google repository to latest version which is 46 means you got to use this version 11.0.46

在此处输入图片说明

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM