This error just happened to me when I launched the app in the store. I’m correcting it now, change the Location library to Gelocator.
At first I thought it was an error in Flutter 3.7.0, I lowered the version to 3.3.10 and 3.3.9 and the same problem continued. My solution was to change the location library to geolocator. It has almost the same functions, I only had to make a few changes.
in my case, got to C:UsersMd Emarat HossainAppDataLocalPubCachehostedpub.dartlang.orglocation-4.4.0androidbuild.gradle and changed "com.google.android.gms:play-services-location:16.+" to "com.google.android.gms:play-services-location:21.0.1" works
No need to change the package I was also facing this issue I just fixed it:
Go into C:UsersQcAppDataLocalPubCachehostedpub.dartlang.orglocation-4.4.0androidbuild.gradle :
changed "com.google.android.gms:play-services-location:16.+" to "com.google.android.gms:play-services-location:21.0.1" works
dependencies {
api ‘"com.google.android.gms:play-services-location:21.0.1’
implementation "androidx.core:core-ktx:1.3.2"
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
}
List item In project at android level go into build.gradle and add this line:
4
Answers
This error just happened to me when I launched the app in the store. I’m correcting it now, change the Location library to Gelocator.
At first I thought it was an error in Flutter 3.7.0, I lowered the version to 3.3.10 and 3.3.9 and the same problem continued. My solution was to change the location library to geolocator. It has almost the same functions, I only had to make a few changes.
https://pub.dev/packages/geolocator
in my case, got to C:UsersMd Emarat HossainAppDataLocalPubCachehostedpub.dartlang.orglocation-4.4.0androidbuild.gradle and changed "com.google.android.gms:play-services-location:16.+" to "com.google.android.gms:play-services-location:21.0.1" works
No need to change the package I was also facing this issue I just fixed it:
Go into C:UsersQcAppDataLocalPubCachehostedpub.dartlang.orglocation-4.4.0androidbuild.gradle :
changed "com.google.android.gms:play-services-location:16.+" to "com.google.android.gms:play-services-location:21.0.1" works
dependencies {
api ‘"com.google.android.gms:play-services-location:21.0.1’
implementation "androidx.core:core-ktx:1.3.2"
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
}
List item In project at android level go into build.gradle and add this line:
I changed from "com.google.android.gms:play-services-location:16.+" to "com.google.android.gms:play-services-location:21.0.1" in my project this PATH
"C:Userschintflutter.pub-cachehostedpub.dartlang.orggeolocator_android-4.1.7androidbuild.gradle"