Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

java.lang.IncompatibleClassChangeError: Found interface com.google.android.gms.location.SettingsClient

FATAL EXCEPTION: main Process: com.example.near_by_api_ex, PID: 10222 java.lang.IncompatibleClassChangeError: Found interface com.google.android.gms.nearby.connection.ConnectionsClient, but class was expected (declaration of 'com.google.android.gms.nearby.connection.ConnectionsClient' appears in /data/app/com.example.near_by_api_ex-SQmqvcjOXV3emcH2l_ILUw==/base.apk)

like image 745
Rahul Avatar asked Oct 29 '25 01:10

Rahul


2 Answers

Solution Very Easy

  1. Open The Project into the Android Studio
  2. Location pub library and geolocator pub libary same implementation 'com.google.android.gms:play-services-location:21.0.1'

like image 167
Arjun Singh Avatar answered Oct 30 '25 18:10

Arjun Singh


There have been some changes in Google's API & versions which are used in Flutter Location Package. We need to wait until they reflect those compatible changes in the package.

PR for that issue: https://github.com/Lyokone/flutterlocation/pull/803

There's a workaround for that. I forked the repo & used it in pubspec but this change is not working in my project. https://github.com/Lyokone/flutterlocation/issues/802#issuecomment-1408420419

like image 25
Hardik Avatar answered Oct 30 '25 18:10

Hardik



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!