Flutter web: build application bundle [duplicate] - flutter

This question already has answers here:
Cannot run with sound null safety because dependencies don't support null safety
(17 answers)
Closed 8 months ago.
I want to build a web application bundle for my flutter project by using the command 'flutter build web'. However, I face an error i.e.
Target dart2js failed: Exception: Warning: The 'dart2js' entrypoint script is deprecated, please use 'dart compile js' instead.
Error: Cannot run with sound null safety, because the following dependencies don't support null safety:
I can run the app in debug mode but can't build the web bundle.

Apparently one of your packages does not support Null Safety and needs to be removed for your application to work.
The error message should tell you which package is affected.
There is no way to continue using it without effort, as it is deprecated and apparently not being developed further. You can fork the package and implement the null safety yourself, which should not be that hard. Or there is already a fork that has implemented it.

Solved: I updated the package that was the cause of the error, and it works now.

Related

I am having error just after restarting computer in flutter Error: A file can't be part of more than one library

I am having this problem since restart and i think due to auto-update package but now i am having this error. This happens when i run my code and stop before executing anything.
Launching lib\main.dart on Edge in debug mode...
/C:/src/flutter_windows_2.10.4-stable/flutter/.pub-cache/hosted/pub.dartlang.org/firebase_core-2.3.0/lib/src/firebase_app.dart: Error: A file can't be part of more than one library.
Try moving the shared declarations into the libraries, or into a new library.
/C:/src/flutter_windows_2.10.4-stable/flutter/.pub-cache/hosted/pub.dartlang.org/firebase_core-2.3.0/lib/firebase_core.dart: Context: Used as a part in this library.
/C:/src/flutter_windows_2.10.4-stable/flutter/.pub-cache/hosted/pub.dartlang.org/firebase_core-2.3.0/lib/firebase_core.dart%20: Context: Used as a part in this library.
/C:/src/flutter_windows_2.10.4-stable/flutter/.pub-cache/hosted/pub.dartlang.org/firebase_core-2.3.0/lib/src/firebase.dart: Error: A file can't be part of more than one library.
Try moving the shared declarations into the libraries, or into a new library.
/C:/src/flutter_windows_2.10.4-stable/flutter/.pub-cache/hosted/pub.dartlang.org/firebase_core-2.3.0/lib/firebase_core.dart: Context: Used as a part in this library.
/C:/src/flutter_windows_2.10.4-stable/flutter/.pub-cache/hosted/pub.dartlang.org/firebase_core-2.3.0/lib/firebase_core.dart%20: Context: Used as a part in this library.
Failed to compile application.
Exited (sigterm)
I have tried pub get, Flutter clean, flutter upgrade downgrade. Help me to resolve this error.

Flutter Null Safety issue

This application is not configured to build on the web.
To add web support to a project, run flutter create ..
Launching lib\main.dart on Chrome in debug mode...
Waiting for connection from debug service on Chrome...
Error: Cannot run with sound null safety, because the following dependencies
don't support null safety:
package:flutter_speed_dial
For solutions, see https://dart.dev/go/unsound-null-safety
Unhandled exception:
You will need at least version 3.0.0 of that package to have null safety.
Given that they are at version 5.0.0 right now, you should probably update your packages every once in a while.
If you want to run without latest version you need to Update the Configuration File,
Edit Configuration
Then,
Add --no-sound-null-safety in Additional run args.
Add Command in Additional run args
Then, Click Apply and Run the app.
Edited:
you will need to latest version and if you want to run without latest version you need to run this command
$ flutter run --no-sound-null-safety

Error Module 'flutter_secure_storage' not found when try Product ->Build for -> Profiling

well this error occurs to me when I try to make my app in production.
The app is created with flutter and I was able to create the apk for android, but when I try to do it for ios it won't let me.
The file that I am opening is Runner.xcworkspace and the problem is the import of a flutter library, it seems to me that I have to make some kind of connection with the pods.
here is the error, I want to tell you that I do not want to run the app, but to make an installer
The error that occurs when building a release (ie. flutter build ipa) and not when running a debug build is:
/[REDACTED]/ios/Runner/GeneratedPluginRegistrant.m:48:9: fatal error: module
'flutter_secure_storage' not found
#import flutter_secure_storage;
~~~~~~~^~~~~~~~~~~~~~~~~~~~~~
1 error generated.
note: Using new build system
For me regenerating Podfile in the following way solved the issue:
rm ios/Podfile && flutter build ios
See Closed [ios][release] GeneratedPluginRegistrant.m Module not found
#43986

Flutter Cannot run with sound null safety, because the following dependencies don't support null safety

I am new to flutter and I got this error when I tried to run the flutter run command. I found many articles related to this issue and got to know that flutter run --no-sound-null-safety is the solution to this issue during development. But my question is that What if I get this error during the production build? How can I handle it there?
flutter build <target> --no-sound-null-safety works too (as does flutter test --no-sound-null-safety FYI).
Note that this is a compilation error. If it fails, you won't get your APK (or whatever you're targeting), so this is not something you need to worry about happening "in production".
However, if you're new to Flutter, and the project is still young, consider trying to remove the null-unsafe dependencies. The command flutter pub outdated --mode=null-safety will give you info on which packages don't support null safety, and whether they can be upgraded.

flutter: Error: The non-abstract class 'RenderParagraphX' is missing implementations for these members, caused by sliding_up_panel-1.0.2

Since I updated flutter, yesterday, I am receiving the following error message:
Launching lib/main.dart on iPhone 11 Pro Max in debug mode...
Running Xcode build...
Xcode build done. 23,5s
Failed to build iOS app
Error output from Xcode build:
↳
** BUILD FAILED **
Xcode's output:
↳
../../.pub-cache/hosted/pub.dartlang.org/assorted_layout_widgets-1.3.4/lib/src/text_one_line.dart:207:7: Error: The non-abstract class 'RenderParagraphX' is missing implementations for these members:
- RenderParagraph.getFullHeightForCaret
Try to either
- provide an implementation,
- inherit an implementation from a superclass or mixin,
- mark the class as abstract, or
- provide a 'noSuchMethod' implementation.
class RenderParagraphX extends RenderBox
^^^^^^^^^^^^^^^^
../../Applications/flutter%20env/flutter/flutter/packages/flutter/lib/src/rendering/paragraph.dart:750:11: Context: 'RenderParagraph.getFullHeightForCaret' is defined here.
double? getFullHeightForCaret(TextPosition position) {
^^^^^^^^^^^^^^^^^^^^^
../../.pub-cache/hosted/pub.dartlang.org/sliding_up_panel-1.0.2/lib/src/panel.dart:218:44: Error: Too few positional arguments: 1 required, 0 given.
VelocityTracker _vt = new VelocityTracker();
^
../../Applications/flutter%20env/flutter/flutter/packages/flutter/lib/src/gestures/velocity_tracker.dart:152:3: Context: Found this candidate, but the arguments don't match.
VelocityTracker(this.kind);
^^^^^^^^^^^^^^^
Command PhaseScriptExecution failed with a nonzero exit code
note: Using new build system
note: Planning build
note: Constructing build description
Could not build the application for the simulator.
Error launching application on iPhone 11 Pro Max.
So I assume sliding_up_panel-1.0.2 has some issue with the newest release.
Unless I want to rely on a soon release of 1.0.3, I guess my only chance is to roll back to the previous flutter release, right (ok, I could also disable all related functionality)?
Is there a simpler approach than to uninstall and re-install the previous version via shell commands. Last time I had quite some difficulties with some configuration files. Currently I am enjoying the neat update feature of IntelliJ IDEA (besides, I am using a Mac).
I can build again :-D
this is what I have done, in case some else experiences this problem:
flutter channel stable
flutter upgrade
flutter clean
PS: Before, I removed all traces of sliding_up_panel, but still got the build errors. Now everything works, including the sliding_up_panel