我正在尝试创建一个新项目,但由于找不到“ pubspec.yaml”,因此抖动立即失败。确实,没有。
它只创建了一个android目录,一个android \ gradle和一个android \ gradle \ wrapper目录,而不是根目录中的单个文件。
以下是创建命令的输出:
$ flutter create -v pics
[ +34 ms] executing: [c:\flutter\] git rev-parse --abbrev-ref --symbolic @{u}
[ +153 ms] Exit code 0 from: git rev-parse --abbrev-ref --symbolic @{u}
[ +2 ms] origin/stable
[ ] executing: [c:\flutter\] git rev-parse --abbrev-ref HEAD
[ +80 ms] Exit code 0 from: git rev-parse --abbrev-ref HEAD
[ ] stable
[ ] executing: [c:\flutter\] git ls-remote --get-url origin
[ +107 ms] Exit code 0 from: git ls-remote --get-url origin
[ ] https://github.com/flutter/flutter.git
[ ] executing: [c:\flutter\] git log -n 1 --pretty=format:%H
[ +76 ms] Exit code 0 from: git log -n 1 --pretty=format:%H
[ ] 5391447fae6209bb21a89e6a5a6583cac1af9b4b
[ ] executing: [c:\flutter\] git log -n 1 --pretty=format:%ar
[ +120 ms] Exit code 0 from: git log -n 1 --pretty=format:%ar
[ ] 6 weeks ago
[ ] executing: [c:\flutter\] git describe --match v*.*.* --first-parent --long --tags
[ +139 ms] Exit code 0 from: git describe --match v*.*.* --first-parent --long --tags
[ ] v1.0.0-0-g5391447fa
[ +386 ms] Creating project pics...
[ +45 ms] "flutter create" took 243ms.
d:\src\flutterapps\pics: no pubspec.yaml found
#0 throwToolExit (package:flutter_tools/src/base/common.dart:26:3)
#1 pubGet (package:flutter_tools/src/dart/pub.dart:87:7)
<asynchronous suspension>
#2 CreateCommand._generateApp (package:flutter_tools/src/commands/create.dart:478:13)
<asynchronous suspension>
#3 CreateCommand.runCommand (package:flutter_tools/src/commands/create.dart:319:37)
<asynchronous suspension>
#4 FlutterCommand.verifyThenRunCommand (package:flutter_tools/src/runner/flutter_command.dart:401:18)
#5 _asyncThenWrapperHelper.<anonymous closure> (dart:async/runtime/libasync_patch.dart:77:64)
#6 _rootRunUnary (dart:async/zone.dart:1132:38)
#7 _CustomZone.runUnary (dart:async/zone.dart:1029:19)
#8 _FutureListener.handleValue (dart:async/future_impl.dart:129:18)
#9 Future._propagateToListeners.handleValueCallback (dart:async/future_impl.dart:642:45)
#10 Future._propagateToListeners (dart:async/future_impl.dart:671:32)
#11 Future._complete (dart:async/future_impl.dart:476:7)
#12 _SyncCompleter.complete (dart:async/future_impl.dart:51:12)
#13 _AsyncAwaitCompleter.complete.<anonymous closure> (dart:async/runtime/libasync_patch.dart:33:20)
#14 _rootRun (dart:async/zone.dart:1124:13)
#15 _CustomZone.run (dart:async/zone.dart:1021:19)
#16 _CustomZone.bindCallback.<anonymous closure> (dart:async/zone.dart:947:23)
#17 _microtaskLoop (dart:async/schedule_microtask.dart:41:21)
#18 _startMicrotaskLoop (dart:async/schedule_microtask.dart:50:5)
#19 _runPendingImmediateCallback (dart:isolate/runtime/libisolate_patch.dart:115:13)
#20 _RawReceivePortImpl._handleMessage (dart:isolate/runtime/libisolate_patch.dart:172:5)
颤振医生命令产生以下输出:
$ flutter doctor
Doctor summary (to see all details, run flutter doctor -v):
[√] Flutter (Channel stable, v1.0.0, on Microsoft Windows [Version 10.0.18309.1000], locale en-US)
[√] Android toolchain - develop for Android devices (Android SDK 27.0.3)
[√] Android Studio (version 3.2)
[√] VS Code, 64-bit edition (version 1.30.1)
[√] Connected device (1 available)
• No issues found!
请告知
答案 0 :(得分:1)
该问题是由扑动安装损坏引起的,未被扑动医生检测到。如Flutter installation corrupted中所述,我运行了以下命令:
git clean -xfd
git stash save --keep-index
git stash drop
git pull
flutter doctor
现在我的“ flutter create pics”效果很好