Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

java.lang.IncompatibleClassChangeError: Found interface com.google.android.gms.location.SettingsClient, [closed]

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.

like image 458
Abdul Kader Hridoy Avatar asked Mar 02 '26 20:03

Abdul Kader Hridoy


1 Answers

No need to change the package I was also facing this issue I just fixed it:

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

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

Update: added the required code

  configurations.all{
      resolutionStrategy{
         force "com.google.android.gms:play-services-location:21.0.1"
      }
 }
like image 64
Syed Rehan Avatar answered Mar 04 '26 09:03

Syed Rehan



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!