radek
May 15, 2020, 2:49pm
1
How to enforce the Dart SDK version for build?
Deploy: Netlify App
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)
Scott
May 19, 2020, 1:59pm
2
Hey @radek ,
You should be able to update this from “dependencies” within your package.json file. Let me know if this helps!
radek
May 19, 2020, 2:49pm
3
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
Hi mate, do you mind letting the rest of us know exactly what you did to build flutter apps on netlify? Thanks.
radek
July 8, 2020, 10:45am
6
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?
radek
July 8, 2020, 11:25am
8
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?
flutter-netlify-build.sh
#!/bin/sh
FLUTTER_BRANCH=`grep channel: .metadata | sed 's/ channel: //g'`
FLUTTER_REVISION=`grep revision: .metadata | sed 's/ revision: //g'`
git clone https://github.com/flutter/flutter.git
cd flutter
git checkout $FLUTTER_BRANCH
git pull origin $FLUTTER_BRANCH
git checkout $FLUTTER_REVISION
cd ..
This file has been truncated. show original
netlify.toml
[build]
command = "./flutter-netlify-build.sh"
publish = "build/web"
radek
July 8, 2020, 7:53pm
10
1 Like