4

I facing the error: warnings found and -Werror specified

/Users/sdaemoninfotech/Flutter/flutter/.pub-cache/hosted/pub.dartlang.org/geolocator-6.2.1/android/src/main/java/com/baseflow/geolocator/location/LocationManagerClient.java:10: warning: [deprecation] LocationProvider in android.location has been deprecated
import android.location.LocationProvider;
                       ^
error: warnings found and -Werror specified
/Users/sdaemoninfotech/Flutter/flutter/.pub-cache/hosted/pub.dartlang.org/geolocator-6.2.1/android/src/main/java/com/baseflow/geolocator/location/LocationMapper.java:29: warning: [deprecation] isFromMockProvider() in Location has been deprecated
      position.put("is_mocked", location.isFromMockProvider());
                                        ^
1 error
2 warnings
warnings found and -Werror specified

I tried to downgrade flutter too. still facing the error

enter image description here

Ankur Shinde
  • 304
  • 4
  • 19
  • What about ugrading the geolocator library ? You're on 6.2.1 while now live is 7.7.1 – esentis Nov 25 '21 at 14:37
  • 1
    Thanks... I added the latest version and solve all other dependency version conflicts and its work. followed below link for it. https://iiro.dev/resolving-dart-package-version-conflicts/ – Ankur Shinde Nov 25 '21 at 16:23

2 Answers2

4

I have the following dependencies:

permission_handler: ^8.1.4+2
geolocator: ^7.6.0
geocoding: ^2.0.0

and fix this by updating like this:

permission_handler: ^8.2.5
geolocator: ^7.7.0
geocoding: ^2.0.1

Also have in build.gradle compileSdkVersion 31

and

in gradle.properties

android.useAndroidX=true
android.enableJetifier=true
Albert
  • 111
  • 1
  • 4
0

I had same issue. Simplest Solution is upgrading the flutter pub. It will solve this issue.

Anees
  • 99
  • 7
  • Hello Anees, and welcome to StackOverflow. Make sure you make your answer as clear as possible. For example: what do you mean by "upgrading the flutter pub"? Do you mean running `flutter pub upgrade`? – hman_codes Mar 13 '22 at 18:00
  • Yes. Sorry about that – Anees Mar 16 '22 at 09:21