Google Play Services 9.2.0 missing classes [duplic

2019-04-04 02:22发布

This question already has an answer here:

After an update to Google Play Services 9.2.0 of 28th, June, there are some missing classes that prevent working projects from compiling:

Error:(24, 35) error: package com.google.android.gms.maps does not exist

The same about Google Places, so if you updated to google play services 9.2.0, your project probably won't compile.

Downgrading to 9.0.2 solves the problem:

compile 'com.google.android.gms:play-services-location:9.0.2'

Does anyone know how to fix the issue in version 9.2.0?

2条回答
唯我独甜
2楼-- · 2019-04-04 02:44

add compile 'com.google.android.gms:play-services:9.2.0'

btw, a good starting point to check is, create a new maps project at current updated android studio (and libs) and have a look whats different

查看更多
做个烂人
3楼-- · 2019-04-04 03:08

Just add the maps library:

compile 'com.google.android.gms:play-services-maps:9.2.0'

and the places library:

compile 'com.google.android.gms:play-services-places:9.2.0'

play-services-location 9.0.2 depends on and automatically brings into your project play-services-maps and play-services-places, have a look at play-services-location-9.0.2.pom. Version 9.2.0 doesn't do that anymore so it is up to you to add it as your project dependency.

For other missing classes you can check here to find the right package (see Table 1 Individual APIs and corresponding build.gradle descriptions): https://developers.google.com/android/guides/setup#add_google_play_services_to_your_project

查看更多
登录 后发表回答