gpt4 book ai didi

mysql - 无法与 SQLJocky 一起使用(未定义类 'SHA1' 和其他错误)

转载 作者:行者123 更新时间:2023-11-29 17:19:52 26 4
gpt4 key购买 nike

如果我尝试为我的 dart 应用程序提供服务,则会出现以下错误:

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

但由于这个错误我不得不更改它:

Because every version of build_runner depends on crypto >=0.9.2 <3.0.0 and crypto >=0.9.2 <2.0.1 depends on convert ^1.0.0, every version of build_runner requires convert ^1.0.0 or crypto ^2.0.1. And because build_runner >=0.6.1 depends on convert ^2.0.1 and sqljocky >=0.7.0 depends on crypto ^0.9.0, build_runner >=0.6.1 is incompatible with sqljocky >=0.7.0. So, because MyDartPage depends on both sqljocky ^0.14.0 and build_runner ^0.9.0, version solving failed.

我的 dart 版本是:

Dart VM version: 2.0.0-dev.67.0 (Tue Jul 3 18:17:07 2018 +0200) on "windows_x64"

如何修复这两个错误?

最佳答案

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

关于mysql - 无法与 SQLJocky 一起使用(未定义类 'SHA1' 和其他错误),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51316159/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com