Home > Software design >  How can I solve this error on "flutter build apk"
How can I solve this error on "flutter build apk"

Time:11-19

The error used to be about geolocator and someone suggested that I should update my sdk versions in my build.gradle file. Now, the error is this and I'm not sure where it's coming from.

enter image description here

My build.gradle:

compileSdkVersion 31

defaultConfig {
    minSdkVersion 23
    targetSdkVersion 29
}

My gradle.properties:

org.gradle.jvmargs=-Xmx1536M
android.useAndroidX=true
android.enableJetifier=true

My SDK:

sdk: ">=2.12.0 <3.0.0"

My dependencies:

  device_info_plus: ^2.1.0
  google_fonts: ^2.1.0
  google_maps_flutter: ^2.0.9
  http: ^0.13.3
  location: ^4.3.0
  otp_text_field: ^1.1.1
  shared_preferences: ^2.0.7
  simple_shadow: ^0.2.0
  dio:
  timer_button: ^2.0.0
  rating_dialog: ^2.0.3
  datetime_picker_formfield:
  select_form_field:
  flutter_polyline_points: ^1.0.0
  flutter_swiper_plus: ^2.0.4
  place_picker: ^0.9.19-nullsafety
  google_maps_place_picker: ^2.1.0-nullsafety.3
  geocoding: ^2.0.0
  image_picker: ^0.8.4
  map_launcher: ^2.1.1
  flutter_svg:
  url_launcher: ^6.0.13
  get: ^4.3.8
  simple_star_rating: ^0.0.3
  webview_flutter: ^2.0.13
  

CodePudding user response:

Try this

cd android && ./gradlew clean

CodePudding user response:

Can you change :

targetSdkVersion 31

Or turn off your firewall

This work for me

  • Related