How to upgrade http dependency in Android Studio

1,296

Solution: I changed the version of http in dependencies (pubspec.yaml) from the older version to http: "^0.13.0" (latest as of 5th March 2021) (get the version from pub.dev and type in http, go to installing tab, and you'll find the version there).

Then run flutter pub get, or whatever suits your needs.

My current dependencies:

dependencies:
  http: "^0.13.0"
  flutter:
    sdk: flutter


  # The following adds the Cupertino Icons font to your application.
  # Use with the CupertinoIcons class for iOS style icons.
  cupertino_icons: ^1.0.0
  firebase_core: ^1.0.0
  firebase_auth: ^1.0.0
  firebase_database: ^6.1.0

If anyone else wants to share anything related, please do! Thank you.

Share:
1,296
virtualpanda
Author by

virtualpanda

Updated on December 28, 2022

Comments

  • virtualpanda
    virtualpanda over 1 year

    flutter pub get:

    Because firebase_auth >=1.0.0 depends on firebase_auth_web ^1.0.0 which depends on http_parser ^4.0.0, firebase_auth >=1.0.0 require
    s http_parser ^4.0.0.
    And because http 0.12.2 depends on http_parser >=0.0.1 <4.0.0 and no versions of http match >0.12.2 <0.13.0, firebase_auth >=1.0.0 i
    s incompatible with http ^0.12.2.
    So, because p1 depends on both http ^0.12.2 and firebase_auth ^1.0.0, version solving failed.
    Running "flutter pub get" in p1...
    pub get failed (1; So, because p1 depends on both http ^0.12.2 and firebase_auth ^1.0.0, version solving failed.)
    
    

    I just ran flutter upgrade so my flutter and dart packages are up to date, and through sdk manager (in tools) I have android 10 and 11 installed along with required sdk tools. Android studio has no pending updates for dev channel. (5th March, 2021) The firebase versions were included just yesterday.

    dependencies:
      http: "^0.12.2"
      flutter:
        sdk: flutter
    
    
     
      cupertino_icons: ^1.0.0
      firebase_core: ^1.0.0
      firebase_auth: ^1.0.0
      firebase_database: ^6.1.0
    

    I apologize if I am missing something right under my nose.

    Edit: Yes, I totally missed it. I just had to look up http in pub.get then change the version. (latest: http: "^0.13.0") Please delete this if required.

    • EJoshuaS - Stand with Ukraine
      EJoshuaS - Stand with Ukraine about 3 years
      Can you add the solution as an answer (rather than editing it into the question) in case someone else has a similar problem? That's more "in keeping with" the usual Stack Overflow format and makes it easier for people to quickly find the information they need.
    • virtualpanda
      virtualpanda about 3 years
      @EJoshuaS - Reinstate Monica oh my bad, thank you, i'll do it now!