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

StackOverflow https://stackoverflow.com/questions/15128391

  •  16-03-2022
  •  | 
  •  

Pergunta

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?

Foi útil?

Solução 2

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

Outras dicas

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 {
Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top