1

Android 12 SDK seems to be stable now

enter image description here

if

compileSdkVersion 30
buildToolsVersion "30.0.3"
defaultConfig {
    minSdkVersion 23
    targetSdkVersion 30

then Play Services Location works fine

but if

compileSdkVersion 31
buildToolsVersion "31.0.0"
defaultConfig {
    minSdkVersion 23
    targetSdkVersion 31

then

enter image description here

p.s. Play Services Location version:

implementation 'com.google.android.gms:play-services-location:18.0.0'
user924
  • 8,146
  • 7
  • 57
  • 139
  • Added in SDK 31 : `android.location.LocationRequest` with `android.location.LocationRequest::Builder`? Probably a long shot as `com.google.android.gms.location.LocationRequest::create` is a completely different namespace and would require an import change to fail rather than a simple target/compile api change. – Mark Aug 30 '21 at 19:51

1 Answers1

0

LocationRequest.PRIORITY_HIGH_ACCURACY is deprecated.

You have to use Priority.PRIORITY_HIGH_ACCURACY instead.

Here is the complete code:

import com.google.android.gms.location.Priority  

and

val locationRequest = LocationRequest.create().apply {
            interval = 5000
            fastestInterval = 1000
            priority = Priority.PRIORITY_HIGH_ACCURACY
        }

Here is the link for your reference.

Viraj Patel
  • 2,113
  • 16
  • 23