0

如果我尝试为我的飞镖应用程序提供服务,则会收到以下错误:

Serving `web` on http://localhost:80 [INFO]
    ------------------------------------------------------------------------ [INFO] Starting Build [INFO] Updating asset graph completed, took 15ms [WARNING] build_web_compilers|entrypoint on web/main.dart: Unable to read sqljocky|lib/sqljocky.ddc.js, check your console or the `.dart_tool/build/generated/sqljocky/lib/sqljocky.ddc.js.errors` log file. [INFO] Running build completed, took 22.2s [INFO] Caching finalized dependency graph completed, took 622ms [SEVERE] build_web_compilers|ddc on package:sqljocky/sqljocky.module: Error compiling dartdevc module:sqljocky|lib/sqljocky.ddc.js

    [error] Undefined class 'SHA1'. (package:sqljocky/src/auth/auth_handler.dart, line 24, col 24) [error] Undefined class 'SHA1'. (package:sqljocky/src/auth/auth_handler.dart, line 28, col 20) [error] Undefined class 'SHA1'. (package:sqljocky/src/auth/auth_handler.dart, line 32, col 20) [error] Invalid override. The type of 'ConnectionPool._removeConnection' ('(_Connection) → dynamic') isn't a subtype of '_ConnectionHelpers._removeConnection' ('(dynamic) → dynamic'). (package:sqljocky/src/connection_pool.dart, line 85, col 3) [error] Invalid override. The type of 'ConnectionPool._releaseConnection' ('(_Connection) → dynamic') isn't a subtype of '_ConnectionHelpers._releaseConnection' ('(dynamic) → dynamic'). (package:sqljocky/src/connection_pool.dart, line 89, col 3) [error] Invalid override. The type of 'ConnectionPool._reuseConnection' ('(_Connection) → dynamic') isn't a subtype of '_ConnectionHelpers._reuseConnection' ('(dynamic) → dynamic'). (package:sqljocky/src/connection_pool.dart, line 105, col 3) [error] Invalid override. The type of '_QuitHandler.processResponse' ('(Buffer) → dynamic') isn't a subtype of '_Handler.processResponse' ('(Buffer) → _HandlerResponse'). (package:sqljocky/src/handlers/quit_handler.dart, line 14, col 3) [error] Invalid override. The type of 'Query._releaseConnection' ('(_Connection) → dynamic') isn't a subtype of '_ConnectionHelpers._releaseConnection' ('(dynamic) → dynamic'). (package:sqljocky/src/query.dart, line 170, col 3) [error] Invalid override. The type of 'Query._reuseConnection' ('(_Connection) → dynamic') isn't a subtype of '_ConnectionHelpers._reuseConnection' ('(dynamic) → dynamic'). (package:sqljocky/src/query.dart, line 179, col 3) [error] Invalid override. The type of 'Query._removeConnection' ('(_Connection) → dynamic') isn't a subtype of '_ConnectionHelpers._removeConnection' ('(dynamic) → dynamic'). (package:sqljocky/src/query.dart, line 185, col 3) [error] Invalid override. The type of 'Transaction._releaseConnection' ('(_Connection) → dynamic') isn't a subtype of '_ConnectionHelpers._releaseConnection' ('(dynamic) → dynamic'). (package:sqljocky/src/transaction.dart, line 85, col 3) [error] Invalid override. The type of 'Transaction._reuseConnection' ('(_Connection) → dynamic') isn't a subtype of '_ConnectionHelpers._reuseConnection' ('(dynamic) → dynamic'). (package:sqljocky/src/transaction.dart, line 89, col 3) [error] Invalid override. The type of 'Transaction._removeConnection' ('(_Connection) → dynamic') isn't a subtype of '_ConnectionHelpers._removeConnection' ('(dynamic) → dynamic'). (package:sqljocky/src/transaction.dart, line 93, col 3)

    Please fix all errors before compiling (warnings are okay). }

[SEVERE] Failed after 22.8s

我没有使用 SQLJocky 的任何功能,这些是我的导入:

import 'dart:async';
import 'dart:convert';

import 'package:angular/angular.dart';
import 'package:angular_components/angular_components.dart';
import 'package:sqljocky/sqljocky.dart';
import 'package:sqljocky/utils.dart';
import 'package:options_file/options_file.dart';

我的 pubspec.yaml:

name: MyDartPage
description: A web app that uses AngularDart Components
# version: 1.0.0
# homepage: https://www.example.com
# author: Mattia <email@example.com>

environment:
  sdk: '>=2.0.0-dev.66.0 <2.0.0'

dependencies:
  angular: any
  angular_components: any
  sqljocky: any


dev_dependencies:
  angular_test: any
  build_runner: any
  build_test: any
  build_web_compilers: any
  test: any

在它看起来像这样之前:

name: MyDartPage
description: A web app that uses AngularDart Components
# version: 1.0.0
# homepage: https://www.example.com
# author: Mattia <email@example.com>

environment:
  sdk: '>=2.0.0-dev.66.0 <2.0.0'

dependencies:
  angular: ^5.0.0-beta
  angular_components: ^0.9.0-beta
  sqljocky: ^0.14.0

dev_dependencies:
  angular_test: ^2.0.0-beta
  build_runner: ^0.9.0
  build_test: ^0.10.2
  build_web_compilers: ^0.4.0
  test: ^1.0.0

但由于此错误,我不得不更改它:

因为 build_runner 的每个版本都依赖于 crypto >=0.9.2 <3.0.0 并且 crypto >=0.9.2 <2.0.1 依赖于 convert ^1.0.0,所以 build_runner 的每个版本都需要 convert ^1.0.0 或 crypto ^2.0 .1。并且因为 build_runner >=0.6.1 依赖于 convert ^2.0.1 而 sqljocky >=0.7.0 依赖于 crypto ^0.9.0,所以 build_runner >=0.6.1 与 sqljocky >=0.7.0 不兼容。所以,因为 MyDartPage 依赖于 sqljocky ^0.14.0 和 build_runner ^0.9.0,版本求解失败。

我的飞镖版本是:

Dart VM 版本:“windows_x64”上的 2.0.0-dev.67.0(2018 年 7 月 3 日星期二 18:17:07 +0200)

如何修复这两个错误?

4

1 回答 1

0

我使用 SQLJocky5 解决了,但在 Dart 2 上我必须做一个 PR 来解决这个问题: https ://github.com/dart-db/sqljocky5/pull/10

于 2018-07-23T09:53:14.127 回答