Flutter web build exits with error due to Dart SDK

How to enforce the Dart SDK version for build?

Deploy: https://app.netlify.com/sites/matikadokapsy/deploys/5ebe9f51c844c007c0859a60

build log:

3:58:51 PM: Running “flutter pub get” in repo…

3:58:52 PM: The current Dart SDK version is 2.6.0-dev.5.0.flutter-d6c6d12ebf.

3:58:52 PM: Because xxxxxx requires SDK version >=2.6.0 <3.0.0, version solving failed.

3:58:52 PM: pub get failed (1)

Hey @radek,

You should be able to update this from “dependencies” within your package.json file. Let me know if this helps!

Actually the reason was that Flutter does not update .metadata files during its upgrades. So everything is correct on the Netlify side.

Resolved. Thanks

1 Like

great, glad its working!

Hi mate, do you mind letting the rest of us know exactly what you did to build flutter apps on netlify? Thanks.

I am building the web release of the flutter app from the last commit. So this is not related to the android / ios apps. Is the flutter web of your interest?

I am using the master channel.
FLUTTER_BRANCH=grep channel: .metadata | sed 's/ channel: //g'
FLUTTER_REVISION=grep revision: .metadata | sed 's/ revision: //g'

git checkout $FLUTTER_BRANCH
git pull origin $FLUTTER_BRANCH
git checkout $FLUTTER_REVISION

Are you using what is mentioned on this?

I am using, what is mentioned here: https://gist.github.com/richard-flosi/8b43c06732d296f1145b8f5d12bf194e#gistcomment-3308949

1 Like