flutter 2.0, build web(stable): Failed to compile application for the Web

1,625 views
Skip to first unread message

Patrick386

unread,
Mar 16, 2021, 10:24:26 PM3/16/21
to Flutter Development (flutter-dev)

Hello there,

Is there any workaround for this problem?

Dart Version: 2.12.1 

Flutter Version: 2.0.2 

channel stable

Package compatibility issue has passed.

regards,

/Patrick

> Flutter build web

 Building with sound null safety 


Target dart2js failed: Exception: ../../flutter/.pub-cache/hosted/pub.dartlang.org/firebase_analytics_web-0.2.0+1/lib/firebase_analytics_web.dart:1:1:

Error: A library can't opt out of null safety by default, when using sound null safety.

// @dart=2.9

^^^^^^^^^^^^

../../flutter/.pub-cache/hosted/pub.dartlang.org/firebase_analytics_platform_interface-1.1.0/lib/firebase_analytics_platform_interface.dart:5:1:

Error: A library can't opt out of null safety by default, when using sound null safety.

// @dart=2.9

^^^^^^^^^^^^

../../flutter/.pub-cache/hosted/pub.dartlang.org/firebase_analytics_platform_interface-1.1.0/lib/method_channel_firebase_analytics.dart:5:1:

Error: A library can't opt out of null safety by default, when using sound null safety.

// @dart=2.9

^^^^^^^^^^^^

Error: Cannot run with sound null safety, because the following dependencies

don't support null safety:


 - package:uuid    << 2.2.2

 - package:excel   << 1.1.5

 - package:pretty_qr_code  << 1.0.1

 - package:qr  

 - package:responsive_table   << 0.1.1+8

 - package:crypto  

 - package:convert 

 - package:archive

 - package:xml

 - package:short_uuids  << 1.0.0

 - package:any_base

 - package:responsive_context 

 - package:petitparser


For solutions, see https://dart.dev/go/unsound-null-safety

Error: Compilation failed.



Compiling lib\main.dart for the Web...                              8.5s

Exception: Failed to compile application for the Web.



Wojciech S. Czarnecki

unread,
Mar 17, 2021, 5:41:25 AM3/17/21
to flutt...@googlegroups.com
Dnia 2021-03-16, o godz. 19:24:26
Patrick386 <patri...@sint.kr> napisał(a):

> Is there any workaround for this problem?

https://dart.dev/null-safety/migration-guide
https://flutter.dev/docs/null-safety

In short: you can't have null safety while your dependencies aren't safe.
Ie. every piece of imported code must first commit to it.

Hope this helps,

--
Wojciech S. Czarnecki
<< ^oo^ >> OHIR-RIPE
Reply all
Reply to author
Forward
0 new messages