3

I just updated my Google dependencies to 12.0.1 and now I'm getting this error where I'm using FusedLocationProviderClient.

enter image description here

Any idea why is this happening? Looking into source code, I can see the the constructors are now hidden:

@Hide
public FusedLocationProviderClient(@NonNull Context var1) {
    super(var1, LocationServices.API, (ApiOptions)null, new zzg());
}

@Hide
public FusedLocationProviderClient(@NonNull Activity var1) {
    super(var1, LocationServices.API, (ApiOptions)null, new zzg());
}

But it doesn't make sense. Why? Google obviously wanted people to migrate to this new Location Provider. Why would they suddenly make it unavailable? I've checked out the docs and I can't find anything about this.

Luckily the code still compiles and location works. But still...why?

Guy
  • 6,414
  • 19
  • 66
  • 136

2 Answers2

5

The documentation could have been clearer, but it seems the intention is for you to call LocationServices.getFusedLocationProviderClient(). See the API here.

Thiago Hirai
  • 76
  • 1
  • 3
2

Upgrade to version 15.0.0 released on the 12th it will clear the warning for you. I don't see anything in release notes or bug reports mentioning this, so it is probably just a bug introduced in 12.0.1.

Chris Stillwell
  • 10,266
  • 10
  • 67
  • 77