i'm having this error with the flutter version for web each time i try to test it. But it works fine on mobile - flutter

Everything works fine and App is already in the play store but when i try to test for a web version it produces below error just for this particular App.
I want to know what is exactly wrong
lib/main.dart:15:8: Error: Error when reading
'lib/generated_plugin_registrant.dart': The system cannot find the
file specified.
import 'package:[NameOfApp goes
here]/generated_plugin_registrant.dart';
^ lib/main.dart:16:8: Error: Error when reading 'lib/generated_plugin_registrant.dart': The system cannot find the
file specified.
org-dartlang-app:/web_entrypoint.dart:11:3: Error: Method not found: 'registerPlugins'.
registerPlugins(webPluginRegistry);
^^^^^^^^^^^^^^^
Failed to compile application.

Related

Swift error in fallback scratch context: error: failed to load module 'AppName'

When I add a breakpoint in code, then I try to po something in lldb I get this error once, and it gets away after printing the variable again.
warning: Swift error in fallback scratch context: error: failed to load module 'AppName'
note: This error message is displayed only once. If the error displayed above is due to conflicting
search paths to Clang modules in different images of the debugged executable,
this can slow down debugging of Swift code significantly,
since a fresh Swift context has to be created every time a conflict is encountered.

Why the app produced by flutter build web sometimes doesn't work?

I have 2 issues that only appear when executing flutter build web.
Sometimes flutter build web fails complaining (wrongly) about types that were not compatible (see below).
Sometimes the build process finishes but then the web app doesn't work: doesn't display anything and there are no messages in the console.
The error I mention is something like this:
% flutter build web
Target dart2js failed: Exception: lib/main.dart:24:31:
Error: A value of type 'ApiUsersRepository' can't be assigned to a variable of type 'UsersRepository'.
- 'ApiUsersRepository' is from 'package:my_app/api_users_repo.dart' ('lib/api_users_repo.dart').
- 'UsersRepository' is from 'lib/users_repo.dart'.
final UsersRepository usersRepository = ApiUsersRepository();
^
Error: Compilation failed.
The app is working in iOS and web when developing.
The solution
I changed all imports of my files like:
import 'package:my_app/users_repo.dart';
To:
import 'users_repo.dart';
More Details
Investigating the error about types, I found this issue, where the important part is this comment: after changing every import to relative format it resolves my problem.
So I did that, and it solved the 2 issues, the compilation error, and the runtime error.
for me I had to remove a package that was corrupted. c:\src\flutter.pub-cache\hosted\pub.dartlang.org\localstorage-4.0.0+1 Apparently, a file had become corrupted by me invertly. I removed the package and did a flutter pub get then recompiled and it worked.

How To Fix This Error [Error: Failed to find '#ionic/angular/css/display.css']

When i run the operation ionic serve it fails to compile and gives an error code that says:
ERROR in ./src/global.scss (./node_modules/#angular-devkit/build-
angular/src/angular-cli-files/plugins/raw-css-
loader.js!./node_modules/postcss-loader/src??embedded!./node_modules/
sass-loader/lib/loader.js??ref--14-3!./src/global.scss)
Module build failed (from ./node_modules/postcss-loader/src/index.js):
Error: Failed to find '#ionic/angular/css/display.css'
in [
C:project/src
]
at resolveModule.catch.catch (project\node_modules\postcss-
import\lib\resolve-id.js:35:13)
This is a piece of code i tried to integrate into my own project which opens the camera to take a picture and you can either upload the picture or delete it. I tried searching for "#ionic/angular/css/display.css" on the internet but couldn't find a solution. I started ionic just recently so i don't understand much about it.
If anyone wants to see the code It is here The original i took it from had the code at home.page.ts but i needed it at tab1.page.ts so the error may be born from this. Also global.scss
The method i used to solve the problem is importing "#ionic/angular/css/display.css". I did it manually taking it from a project where it exists and copying it to the Project which gives the error.

Swift build error_if_any_output_files_are_specified_they_all_must_be

When converting to use the new build system on Xcode 10, I get the following error in my output for several of my extension targets.
<unknown>:0: error: if any output files are specified, they all must be
Command CompileSwift failed with a nonzero exit code
I have looked for a solution online, but the only reference I can find to this error is in the Swift compiler source code itself.
https://www.google.com/search?q=error_if_any_output_files_are_specified_they_all_must_be
Does anyone know how this error is actually triggered, or what I can do to fix it?
Ok, I had the same problem with one of our projects. Building or Archiving are always stopped with the error <unknown>:0: error: if any output files are specified, they all must be.
The solution for us was to set Compilation Mode to Incremental instead of Whole Module.
This means, you have to ignore the Validate Project Settings warning:

Bundling app with SystemJS using 3rd party library?

How can I get the systemjs builder to ignore third party libraries? We are evaluating wijmo controls for use in an app and they provide wijmo.angular2.min.js, wijmo.input.min.js and wijmo.min.js. We load these after SystemJS in our web page and that works fine because those files register the wijmo modules. However, when we try to bundle it throws an error because it cannot find the files. Sample error:
Unhandled rejection Error on fetch for vendor/wijmo/wijmo.angular2.input.js
at file:///C:/git/prj/dist/vendor/wijmo/wijmo.angular2.input.js
I can add this path to my config but then I get a different error:
'wijmo/*': 'vendor/wijmo/wijmo.angular2.min.js'
Error:
Unhandled rejection TypeError: Error compiling register module "wijmo/wijmo.angular2.input"
at vendor\wijmo\wijmo.angular2.min.js
Source vendor\wijmo\wijmo.angular2.min.js is already a bundle file, so can't
be built as a module.
Edit
Adding this path lets bundling work (at least it builds the bundles), but keeping the line in my config causes the app to error out, apparently being unable to find the class I'm importing (throws unexpected directive 'undefined')...
'wijmo/wijmo.angular2.input': 'vendor/wijmo/wijmo.input.min.js'
I got it to work by adding a 'meta' section to my SystemJS config that told it not to build that path:
var meta = {
'wijmo/*': {
format: 'global',
build: false,
}
};