DineshkumarBalan
DineshkumarBalan

Reputation: 124

Flutter : geolocator dependecy issues - Build error

I'm getting the below error while building my flutter application itself.

C:\Users\Admin\AppData\Local\Pub\Cache\hosted\pub.dev\geolocator_android-4.2.2\android\src\main\java\com\baseflow\geolocator\location\FusedLocationClient.java:91: error: cannot find symbol
    LocationRequest.Builder builder = new LocationRequest.Builder(0);
                   ^
  symbol:   class Builder
  location: class LocationRequest
C:\Users\Admin\AppData\Local\Pub\Cache\hosted\pub.dev\geolocator_android-4.2.2\android\src\main\java\com\baseflow\geolocator\location\FusedLocationClient.java:91: error: cannot find symbol
    LocationRequest.Builder builder = new LocationRequest.Builder(0);
                                                         ^
  symbol:   class Builder
  location: class LocationRequest
2 errors

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':geolocator_android:compileDebugJavaWithJavac'.

I'm using the below environment setup for in the pubspec.yaml

environment:
  sdk: ">=2.16.2 <3.0.0"
dependencies:
  flutter:
    sdk: flutter

  cupertino_icons: ^1.0.5
  get: ^4.6.5
  google_fonts: ^4.0.4
  lottie: ^1.4.2
  dob_input_field: ^2.0.0
  intl: ^0.17.0
  google_maps_flutter: ^2.2.3
  google_maps_flutter_web: ^0.4.0+5
  fluttertoast: ^8.2.1
  geocoding: ^2.0.5
  geocoder2: ^1.4.0
  flutter_polyline_points: ^1.0.0
  booking_calendar: ^1.1.9
  dropdown_button2: ^1.4.0
  intl_phone_field: ^3.1.0
  dropdown_textfield: ^1.0.1
  json_annotation: ^4.6.0
  dio: ^4.0.1
  retrofit: ^3.0.1+1
  retrofit_generator: ^4.0.1
  _fe_analyzer_shared: ^40.0.0
  logger: ^1.4.0
  table_calendar: ^3.0.8
  shared_preferences: ^2.0.17
  location: ^4.4.0
  image_picker: ^0.8.6
  flutter_google_places: ^0.3.0
  url_launcher: ^6.1.8
  carousel_slider: ^4.2.1
  barcode_scan2: ^4.2.4
  paytm_allinonesdk: ^1.1.7
  modal_bottom_sheet: ^2.0.1
  webview_flutter: ^3.0.4
  google_maps: ^6.2.0
  permission_handler: ^11.0.0
  flutter_dotenv: ^5.0.2
  geolocator: ^9.0.2
flutter:

  uses-material-design: true

  assets:
    - assets/

Could anyone suggest me the changes to resolve this issue?

I have modified the different version of geolocator and geocoding to verify but no changes.

I have cross-verified the flutter forum also, many developer is facing the similar problem but no solution has been found.

Upvotes: 0

Views: 350

Answers (1)

Depresif Amca
Depresif Amca

Reputation: 21

The problem should be solved when you run the "flutter clean" and then "flutter run" codes from the terminal.

Upvotes: 0

Related Questions