I can't run the app on the emulator or on a real device. When I try to run the app from VS Code, it shows this error message:

I tried uninstalling the app and doing flutter clean.
No need to change the package I was also facing this issue I just fixed it:
Go into C:\Users\Qc\AppData\Local\Pub\Cache\hosted\pub.dartlang.org\location-4.4.0\android\build.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:

Update: added the required code
configurations.all{
resolutionStrategy{
force "com.google.android.gms:play-services-location:21.0.1"
}
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With