skip to Main Content

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:

screenshot of debug console

I tried uninstalling the app and doing flutter clean.

4

Answers


  1. 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

    Login or Signup to reply.
  2. 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

    Login or Signup to reply.
  3. No need to change the package I was also facing this issue I just fixed it:

    1. 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"
      }

    2. List item In project at android level go into build.gradle and add this line:
      enter image description here

    Login or Signup to reply.
  4. 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"

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search