user3783123
user3783123

Reputation: 554

Unable to add google_sign_in to flutter project, package requires older version of Flutter SDK?

New to Flutter so sorry about the question. Tried to change the environment but project won't build.

The current Flutter SDK version is 1.9.1+hotfix.6.



Because solemaster depends on google_sign_in >=4.0.16 which requires Flutter SDK version 
>=1.10.0 <2.0.0, version solving failed.
pub get failed (1)

environment:
  sdk: ">=2.1.0 <3.0.0"

Upvotes: 0

Views: 1092

Answers (2)

Antonio Arista
Antonio Arista

Reputation: 1

try

flutter pub cache repair
flutter clean

Upvotes: -1

George Rappel
George Rappel

Reputation: 7198

The flutter SDK version you're using is older than the required by the library. You're confusing the Flutter SDK with the Dart SDK. The Dark SDK is the environment on the code you provided.

google_sign_in is based on the Flutter beta channel, instead of the stable channel. (p.s. this channel is where you get your flutter updates from).

From there, you have two options:

  1. Use an older version of google_sign_in. Version 4.0.15 or 4.0.14 should do the trick, since this change was published today as said on the changelog. On the pubspec.yaml file, change the current declaration to google_sign_in: 4.0.15.

  2. Change to the beta channel. Keep in mind that the Flutter versions here are being tested, so you may experience some issues. To change channel, run flutter channel beta, then flutter upgrade.

Upvotes: 5

Related Questions