Skip to content

Building web without null safety fails in 3.3.0 #109160

@MatthewPatience

Description

@MatthewPatience

Steps to Reproduce

  1. Create a flutter application without any null safe code and set the sdk constraints as sdk: ">=2.11.0 <3.0.0" to disable null safety features
  2. Using Flutter 3.3.0 from the beta channel, run flutter build web --release
  3. The build should fail

Logs

Of special note below is use of an optional on Registrar in the web_plugin_registrant which causes an error since the requested Dart version doesn't support it. I believe this change was made in the following commit: 1af8cc1

Logs
Building without sound null safety
For more information see https://dart.dev/null-safety/unsound-null-safety

Compiling lib/main.dart for the Web...                          
Target dart2js failed: Exception: Warning: The 'dart2js' entrypoint script is deprecated, please use 'dart compile js' instead.
.dart_tool/flutter_build/572d7750549a8327067a38f83ec01c02/web_plugin_registrant.dart:31:38:
Error: Null safety features are disabled for this library.
void registerPlugins([final Registrar? pluginRegistrar]) {
                                     ^
Error: Compilation failed.

Compiling lib/main.dart for the Web...                             29.4s
Exception: Failed to compile application for the Web.


Build failed :|
Failed to build for Web
[✓] Flutter (Channel beta, 3.3.0-0.2.pre, on macOS 12.4 21F79 darwin-arm, locale en-CA)
    • Flutter version 3.3.0-0.2.pre on channel beta at /Users/matthewpatience/fluttersdk
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 7ac27ac8e6 (6 days ago), 2022-08-02 14:35:08 -0700
    • Engine revision d1e7dc18bf
    • Dart version 2.18.0 (build 2.18.0-271.4.beta)
    • DevTools version 2.15.0

[✓] Android toolchain - develop for Android devices (Android SDK version 33.0.0-rc1)
    • Android SDK at /Users/matthewpatience/Library/Android/sdk
    • Platform android-33, build-tools 33.0.0-rc1
    • Java binary at: /Applications/Android Studio.app/Contents/jre/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 11.0.12+0-b1504.28-7817840)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 13.4.1)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Build 13F100
    • CocoaPods version 1.11.3

[✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 2021.2)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 11.0.12+0-b1504.28-7817840)

[✓] VS Code (version 1.69.0)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension can be installed from:
      🔨 https://marketplace.visualstudio.com/items?itemName=Dart-Code.flutter

[✓] Connected device (2 available)
    • macOS (desktop) • macos  • darwin-arm64   • macOS 12.4 21F79 darwin-arm
    • Chrome (web)    • chrome • web-javascript • Google Chrome 103.0.5060.134

[✓] HTTP Host Availability
    • All required HTTP hosts are available

• No issues found!

Metadata

Metadata

Labels

P1High-priority issues at the top of the work lista: buildBuilding flutter applications with the toolc: crashStack traces logged to the consolefound in release: 3.1Found to occur in 3.1found in release: 3.3Found to occur in 3.3has reproducible stepsThe issue has been confirmed reproducible and is ready to work onplatform-webWeb applications specificallyr: fixedIssue is closed as already fixed in a newer versiontoolAffects the "flutter" command-line tool. See also t: labels.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions