Weird circular dependencies after updating to AngularDart 0.10.0 - dart

After updating from AngularDart 0.9.9 to 0.10.0 I encountered weird error messages:
Cannot resolve a circular dependency! (resolving ElementProbe -> ElementProbe -> ElementProbe...
The stack trace doesn't contain any method or class of mine, except applicationFactory().run();
What has happened, and how to fix it?

This is a known bug https://github.com/angular/angular.dart/issues/961.
You need to ensure you have di version 0.0.40 which contains a fix.

No idea whether it's a good idea what I did to fix the error, but here is my solution:
I suspect pub update didn't delete every old class. So I deleted the every package in the packages folder, and ran pub get again.

Related

the Dart compiler exited unexpectedly

I was debugging my project. After some execution, it started showing an error saying that the Dart compiler exited unexpectedly (see screenshot below). I also updated my dart SDK, but nothing happened. I did search on Google, but found nothing that helped.
try this may help
flutter clean
This issue could also happen when you have migrated to Null-Safety. The reason is that when migrating to Null-Safety, all packages need to also be migrated to Null-Safety, thus it will return an error saying:
Error: Cannot run with sound null safety, because the following dependencies
don't support null safety:
Also, it will give you a link for you to reference:
For solutions, see https://dart.dev/go/unsound-null-safety
Unhandled exception:
Bad state: Unsupported Null Safety mode NonNullableByDefaultCompiledMode.Invalid, in null.
Since this issue results in an error, you won't be able to run your project or package unless all packages in your dependencies are null-safety migrated. The dart compiler will end after this.
the Dart compiler exited unexpectedly.
Failed to compile application.
Exited (sigterm)
If you get the issue and you are sure that all packages are up-to-date and that all support Null-Safety, try running flutter clean. This will clear or packages in your project and reinstall them, cache files will also be removed.
Please leave down a comment if you may have any suggestions, or edit this answer if you wish.
I had this problem after adding package golden_toolkit and one golden test I wrote for it. Removing the test file and the dependency from pubspec.yaml and then running flutter clean, flutter pub get fixed it.
In my case flutter clean cant help. My flutter/bin/cache folder was corrupted. Deleting flutter/bin/cache folder and then running command flutter, downloads dart SDK and then setting up the flutter sdk path by giving your flutter folder path in Android Studio -> Preferences -> Languages and Frameworks -> Flutter , solves my problem.
delete flutter/bin/cache then type in terminal flutter clean then flutter run
that's work for me
My case was really strange and I don't know were it comes from, is it VS or Dart
The point is somewhere here where I set my class as the generic of the base class: class MyClass extends MyBaseClass<MyClass> and add an instance to the VS WATCH and set a beark point after the instance creation.
class MyBaseClass<T> {}
class MyClass extends MyBaseClass<MyClass> {
#override
String toString() => "MyClassObject";
}
main() {
MyClass o = MyClass();
print(o); // If you add 'o' to your WATCH items and add a breakpoint here it will crash
}
if you add any packages it can be the problem.
just use
flutter clean
flutter pub get
flutter run

Resource-Target of pod erroneously needing Swift Version set

After successfully linting and updating a pod, I updated it in the main project. However, upon cleaning I encountered this issue:
Normally this is simple to resolve (go to Build Settings and set the Swift Language Version -- however, this error is occurring on the Resource-Target, which doesn't have that setting...making it very strange that I am running into this error.
I've figured out how to resolve this.
The Resource-Target includes a xcdatamodel. I needed to change the Code Generation to Objective-C rather than Swift. This was hard to find especially since the pod lint step did not catch this or give any warning.
I found this answer via: https://github.com/CocoaPods/CocoaPods/issues/7950 -- even though this issue doesn't seem to be exactly the same as this one, but it is related.

RxSwift tutorial example: Attribute can only be applied to types, not declarations

I am trying to go through the RxSwift tutorial here:
https://www.raywenderlich.com/138547/getting-started-with-rxswift-and-rxcocoa
After downloading their example code, and doing pod install successfully, the build is still failing. It is showing the error in the Lock.swift file and is shown below:
What should I do to eliminate the error and make it to run? It is disappointing that the tutorial is not up to date. Any suggestions would be greatly appreciated.
Even though the error will be gone after removing the #noescapeattribute, it's not the correct way to fix the error. Manually editing the pod files are not recommended.
To fix this error, open the terminal and heading to the project folder. Simply type pod update. After updating the pods, all the errors will be gone.
Just remove #noescape will fix the error. #noescape is default
func performLocked(action: () -> Void)

Project does not compile after update of thinktecture.identitymodel 2.6

I have updated my project yesterday with IdentityModel 2.6, and I can't find why it does not compile anymore with this error.
error ASPRUNTIME : The pre-application start initialization method Start on type
Thinktecture.IdentityModel.Web.Configuration.AppStart threw an exception with the
following error message: Value cannot be null.
I have just updated the package, no code change.
EDIT:
The problem comes from missing web.config section described here http://brockallen.com/2013/05/28/configuration-for-wif-session-helper-apis-in-thinktecture-identitymodel/
This seems mandatory and all attributes must be filled otherwise it throws...
sessionTokenCacheType for exemple must be filled...
It would be great to have more information on this.
TIA
That's a bug in 2.6. Please upgrade to 2.6.1
This was a bug and has been fixed in 2.6.1. Update from NuGet again. Sorry for the inconvenience.

Why does the first step in the "Get Started With Web UI" tutorial cause an error and what does the error mean?

I'm going through the "targets" (tutorials) at dartlang.org. I'm at Target 6: Get Started with Web UI and have run into an error at step #1 under the section "Set up background compilation in Dart Editor".
Could someone explain why this error is happening, or what I could do to resolve it? The error is below.
Error setting breakpoint at 'main': 'package:logging/logging.dart':
Error: line 250 pos 24: wrong number of type arguments in type 'Comparable'
class Level implements Comparable<Level> {
^
I have not changed anything in any logging package, nor messed with any Comparable class. What gives?
Take a look at this question. I actually don't know why is this happening(If someone of the dart dev team is reading this, please, explain us :D), but it seems that they changed the Comparable interface structure in M3, and forgot to update the logging package ;)
To solve your problem, go to the "logging.dart" file and make this change:
FROM:
class Level implements Comparable<Level> {
TO:
class Level implements Comparable {
This is probably related to incompatibilities between the version of the SDK you are running and the version of web_ui. If you have the most recent version of both, they work together. If you don't want to use the most recent versions, then you have to explicitly manage the versions in your pubspec.yaml file.
I'm using Dart Editor version: 0.4.0_r18915 and web_ui version: 0.4.0
and it works fine.
Try getting the most recent version of Dart Editor, remove the pubspec.lock file, and run pub install again.
Meanwhile, I will figure out how to strengthen the language in the tutorial about managing versions.
Hope this helps.
mem

Resources