Search code examples
flutterdartnetlify

Flutter Web and Dart SDK issues on Netlify


Out of nowhere I am getting a build error with netflify deploy. A week or two ago I was not getting a build error related to dependency mismatch.

11:08:20 AM: The current Dart SDK version is 3.1.0-47.0.dev. 11:08:20 AM: Because responsive_builder 0.6.4 requires SDK version >=2.17.0 <=3.0.0 and no versions of responsive_builder match >0.6.4 <0.7.0, responsive_builder ^0.6.4 is forbidden.

I am using this build command in netlify

if cd flutter; then git pull && cd ..; else git clone https://github.com/flutter/flutter.git; fi && flutter/bin/flutter config --enable-web && flutter/bin/flutter build web --release

Current envirnonment in my pubspec issdk: ">=2.19.1 <3.0.0".

Also this project was building fine a week or so ago. Could the current version of flutter be using the dev Dart SDK? Im finding this a little tricky to debug. Thanks in advance.


Solution

  • You're currently running from Flutter's master branch, which has the Dart 3.1 dev release as of a couple of weeks ago. You should only work off of master if you're doing active development on the Flutter framework or there's a critical bug fix that you need for your project that hasn't made its way into a beta or stable release yet.

    If you run flutter channel stable, you'll get the latest Flutter stable release which is shipped with Dart 2.19 and will satisfy the SDK constraints for your project. If you're adventurous and want early access to features from the upcoming stable release, run flutter channel beta which will get you a Flutter framework with the Dart 3.0 beta.