I have compileSdkVersion 32 and now I can create LocationRequest only using LocationRequest.Builder. LocationRequest.create() currently unavailable, means I can't even call this deprecated static method. So any suggestions how to create LocationRequest for API lower than 31? Thanks.
Create LocationRequest for API lower than 31
790 Views Asked by Konstantin Konopko At
3
There are 3 best solutions below
0
On
You cannot create a LocationRequest on API Level 30 and below, because LocationRequest itself was added in API Level 31.
You should be able to use LocationRequestCompat as a backwards-compatible replacement, used with LocationManagerCompat.
0
On
Update location service library to the late version and use correct import, for me the latest version right now is
implementation 'com.google.android.gms:play-services-location:21.0.1'
this version may have been changed when you will be seeing this answer, so make sure to update to the latest version.
Solved with using
com.google.android.gms.location.LocationRequest