1

I have a working Android app using:

  • Google Maps (play-services-maps)
  • Google Location, Activity Recognition, and Places (play-services-location)
  • Google Analytics (play-services-analytics)
  • Google Mobile Ads (play-services-ads)

I'm currently using version 8.3.0, everything works fine. I'd like to upgrade to the last version, 9.2.0. When I change the number in the gradle files, Android Studio is unable to find the APIs packages & classes (saying "package XXX does not exist" and "Cannot find symbol class YYY").

I currently have no google-services.json file, do I need it now? I tried without success, probably because I have several modules / submodules, and I don't know where the json file is needed or not.

The problem is that I need a package name to create the JSON file, and I have some library modules, without package name, using Google APIs.

If needed, here is the project structure:

enter image description here

Tim Autin
  • 5,663
  • 5
  • 40
  • 65

2 Answers2

0

Maybe you did something wrong while upgrading your project. Make sure you follow the correct steps in upgrading. I suggest you to retry the process of upgrading, but make sure you do the correct way. Like in configuring your build and setting up Google play service.

For your question about google-services.json, Google-services.json contains developer credentials and configuration settings, which is needed to verify while connecting with GoogleApiClient. Though your service is working fine without it. But it will only work with your test device, as it is detecting your developer account. And after you releae your app in public, it will not work without the json file. So you need it and don't delete.

sources: What does google-services.json really do?

Community
  • 1
  • 1
KENdi
  • 7,205
  • 2
  • 14
  • 26
  • Thanks, but I found not much help on these links. The app is released and working fine currently, without the json file. Is it required as of version 9? For the upgrading steps, well, what I did is: update Google Play Services from the package manager, and then change the version number from 8.3.0 to 9.2.0 in my Gradle files. I don't think I missed a step, I already updated this in the past, with no trouble :/ – Tim Autin Jun 30 '16 at 09:47
0

So, I finally got it: I was using the AutocompletePrediction.getDescription() method, which has simply been removed (and replaced by AutocompletePrediction.getDescription .getFullText()). That call made gradle stops building -_- .

Thanks Google for removing stuff without deprecating it for a while (though the docs says that the method is deprecated: https://developers.google.com/places/android-api/releases)...

I can also confirm that in my case, the google-service.json file is NOT required.

Tim Autin
  • 5,663
  • 5
  • 40
  • 65