0

我有最新的颤振和飞镖。我创建了一个基本应用程序,然后使用 moor 网站上的入门代码:https ://moor.simonbinder.eu/docs/getting-started/

当我执行构建运行程序时,它运行但在 moor 构建中没有错误消息退出,但没有创建 moor_test.g.dart 文件。

这是构建运行器的详细输出:



Windows PowerShell
Copyright (C) Microsoft Corporation. All rights reserved.

Try the new cross-platform PowerShell https://aka.ms/pscore6

PS C:\src\flutterExamples\moor_test> flutter packages pub run build_runner build --verbose
[  +72 ms] executing: [C:\src\flutter\flutter/] git -c log.showSignature=false log -n 1 --pretty=format:%H
[  +73 ms] Exit code 0 from: git -c log.showSignature=false log -n 1 --pretty=format:%H
[        ] 40e3489254b2d0ffedf840bd9233e5e6d06d09dd
[        ] executing: [C:\src\flutter\flutter/] git tag --points-at 40e3489254b2d0ffedf840bd9233e5e6d06d09dd
[  +86 ms] Exit code 0 from: git tag --points-at 40e3489254b2d0ffedf840bd9233e5e6d06d09dd
[   +1 ms] executing: [C:\src\flutter\flutter/] git describe --match *.*.* --long --tags 40e3489254b2d0ffedf840bd9233e5e6d06d09dd
[ +140 ms] Exit code 0 from: git describe --match *.*.* --long --tags 40e3489254b2d0ffedf840bd9233e5e6d06d09dd
[   +2 ms] 2.1.0-12.0.pre-86-g40e3489254
[  +42 ms] executing: [C:\src\flutter\flutter/] git rev-parse --abbrev-ref --symbolic @{u}
[  +50 ms] Exit code 0 from: git rev-parse --abbrev-ref --symbolic @{u}
[        ] origin/master
[        ] executing: [C:\src\flutter\flutter/] git ls-remote --get-url origin
[  +48 ms] Exit code 0 from: git ls-remote --get-url origin
[        ] https://github.com/flutter/flutter.git
[  +77 ms] executing: [C:\src\flutter\flutter/] git rev-parse --abbrev-ref HEAD
[  +61 ms] Exit code 0 from: git rev-parse --abbrev-ref HEAD
[        ] master
[  +81 ms] Artifact Instance of 'AndroidGenSnapshotArtifacts' is not required, skipping update.
[   +1 ms] Artifact Instance of 'AndroidInternalBuildArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'IOSEngineArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'FlutterWebSdk' is not required, skipping update.
[   +3 ms] Artifact Instance of 'WindowsEngineArtifacts' is not required, skipping update.
[   +1 ms] Artifact Instance of 'MacOSEngineArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'LinuxEngineArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'LinuxFuchsiaSDKArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'MacOSFuchsiaSDKArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'FlutterRunnerSDKArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'FlutterRunnerDebugSymbols' is not required, skipping update.
[  +48 ms] Artifact Instance of 'MaterialFonts' is not required, skipping update.
[        ] Artifact Instance of 'GradleWrapper' is not required, skipping update.
[        ] Artifact Instance of 'AndroidGenSnapshotArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'AndroidInternalBuildArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'IOSEngineArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'FlutterWebSdk' is not required, skipping update.
[        ] Artifact Instance of 'FlutterSdk' is not required, skipping update.
[        ] Artifact Instance of 'WindowsEngineArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'MacOSEngineArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'LinuxEngineArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'LinuxFuchsiaSDKArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'MacOSFuchsiaSDKArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'FlutterRunnerSDKArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'FlutterRunnerDebugSymbols' is not required, skipping update.
[        ] Artifact Instance of 'IosUsbArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'IosUsbArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'IosUsbArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'IosUsbArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'IosUsbArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'FontSubsetArtifacts' is not required, skipping update.
[        ] Artifact Instance of 'PubDependencies' is not required, skipping update.
[  +27 ms] Using C:\src\flutter\flutter\.pub-cache for the pub cache.
[   +1 ms] executing: C:\src\flutter\flutter\bin\cache\dart-sdk\bin\pub.bat run build_runner build --verbose
[INFO] Entrypoint:Generating build script...
[INFO] Entrypoint:Generating build script completed, took 321ms

[INFO] Bootstrap:Creating build script snapshot......
[FINE] Bootstrap:stdout: Info: Compiling without sound null safety
[INFO] Bootstrap:Creating build script snapshot... completed, took 11.2s

[INFO] Bootstrap:There was output on stdout while compiling the build script snapshot, run with `--verbose` to see it (you will need to run a `clean` first to re-snapshot).

[FINE] Bootstrap:Core package locations file does not exist
[INFO] BuildDefinition:Initializing inputs
[INFO] BuildDefinition:Building new asset graph...
[INFO] BuildDefinition:Building new asset graph completed, took 962ms

[INFO] BuildDefinition:Checking for unexpected pre-existing outputs....
[INFO] BuildDefinition:Checking for unexpected pre-existing outputs. completed, took 1ms

[INFO] Build:Running build...
[WARNING] moor_generator:moor_generator on lib/data/moor_test.dart:
Your current `analyzer` version may not fully support your current SDK version.

Please try upgrading to the latest `analyzer` by running `flutter packages upgrade`.

Analyzer language version: 2.12.0
SDK language version: 2.13.0

If you are getting this message and have the latest analyzer please file
an issue at https://github.com/dart-lang/sdk/issues/new with the title
"No published analyzer available for language version 2.13.0".
Please search the issue tracker first and thumbs up and/or subscribe to
existing issues if present to avoid duplicates.

[INFO] build_resolvers:Generating SDK summary...
[INFO] Heartbeat:3.1s elapsed, 0/3 actions completed.
[INFO] build_resolvers:Generating SDK summary completed, took 3.0s

[FINE] moor_generator:moor_generator on lib/data/moor_test.dart:Running MoorGenerator - 1 of 2
[FINE] moor_generator:moor_generator on lib/data/moor_test.dart:Running DaoGenerator - 2 of 2
[INFO] Heartbeat:5.1s elapsed, 0/3 actions completed.
[INFO] Heartbeat:10.4s elapsed, 1/3 actions completed.
[FINE] moor_generator:moor_generator on lib/main.dart:Running MoorGenerator - 1 of 2
[FINE] moor_generator:moor_generator on test/widget_test.dart:Running MoorGenerator - 1 of 2
[FINE] moor_generator:moor_generator on lib/main.dart:Running DaoGenerator - 2 of 2
[FINE] moor_generator:moor_generator on test/widget_test.dart:Running DaoGenerator - 2 of 2
[INFO] Build:Running build completed, took 11.3s

[INFO] Build:Caching finalized dependency graph...
[INFO] Build:Caching finalized dependency graph completed, took 30ms

[INFO] Build:Succeeded after 11.3s with 0 outputs (6 actions)

[+36878 ms] "flutter pub" took 36,987ms.
[ +117 ms] ensureAnalyticsSent: 112ms
[   +2 ms] Running shutdown hooks
[        ] Shutdown hooks complete
[   +1 ms] exiting with code 0

这是我的 pubspec.yaml 文件:

name: moor_test
description: A new Flutter project.

publish_to: 'none' # Remove this line if you wish to publish to pub.dev

version: 1.0.0+1

environment:
  sdk: ">=2.7.0 <3.0.0"

dependencies:
  flutter:
    sdk: flutter
  moor: # use the latest version
  sqlite3_flutter_libs: # Also use the latest version.
  path_provider:
  path:

  cupertino_icons: ^1.0.2

dev_dependencies:
  flutter_test:
    sdk: flutter
  moor_generator: # use the latest version
  build_runner: 

flutter:
  uses-material-design: true

还有我的沼泽班:

import 'package:moor/moor.dart';

part 'moor_test.g.dart';

class Todos extends Table {
  IntColumn get id => integer().autoIncrement()();
  TextColumn get title => text().withLength(min: 6, max: 32)();
  TextColumn get content => text().named('body')();
  IntColumn get category => integer().nullable()();
}

@DataClassName("Category")
class Categories extends Table {
  
  IntColumn get id => integer().autoIncrement()();
  TextColumn get description => text()();
}

@UseMoor(tables: [Todos, Categories])
class MyDatabase {
  
}

有谁知道我做错了什么或者可以提示我去哪里调试?

4

0 回答 0