gpt4 book ai didi

flutter - 如何修复 "flutter has exited unexpectedly"

转载 作者:行者123 更新时间:2023-12-03 02:48:16 31 4
gpt4 key购买 nike

我正在 macOS 上使用 flutter 开发一个应用程序。当我切换到windows机器开发时,出现如下错误

哎呀; flutter 意外退出。向谷歌发送崩溃报告。已发送崩溃报告(报告 ID:4c15631f67927e73)崩溃报告写入D:\hcbmobile\flutter_11.log;请通过https://github.com/flutter/flutter/issues告诉我们.

我已经在此链接中创建了问题:https://github.com/flutter/flutter/issues/33645

生成的日志文件显示以下崩溃报告:

命令

flutter run --machine -t lib\main.dart -d B3698Y11HA4122 --track-widget-creation --start-paused

异常

FileSystemException:FileSystemException:无法打开文件,路径 = 'D:\hcbmobile.flutter-plugins'(操作系统错误:访问被拒绝。, 错误号 = 5)

#0      _File.throwIfError (dart:io/file_impl.dart:643:7)
#1 _File.openSync (dart:io/file_impl.dart:487:5)
#2 _File.writeAsBytesSync (dart:io/file_impl.dart:612:31)
#3 _File.writeAsStringSync (dart:io/file_impl.dart:636:5)
#4 _LocalFile&LocalFileSystemEntity&ForwardingFile.writeAsStringSync (package:file/src/forwarding/forwarding_file.dart:147:16)
#5 _writeFlutterPluginsList (package:flutter_tools/src/plugins.dart:104:17)
#6 refreshPluginsList (package:flutter_tools/src/plugins.dart:297:24)
#7 FlutterProject.ensureReadyForPlatformSpecificTooling (package:flutter_tools/src/project.dart:175:5)
<asynchronous suspension>
#8 FlutterCommand.verifyThenRunCommand (package:flutter_tools/src/runner/flutter_command.dart:478:21)
<asynchronous suspension>
#9 FlutterCommand.run.<anonymous closure> (package:flutter_tools/src/runner/flutter_command.dart:424:33)
<asynchronous suspension>
#10 AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:153:29)
<asynchronous suspension>
#11 _rootRun (dart:async/zone.dart:1124:13)
#12 _CustomZone.run (dart:async/zone.dart:1021:19)
#13 _runZoned (dart:async/zone.dart:1516:10)
#14 runZoned (dart:async/zone.dart:1463:12)
#15 AppContext.run (package:flutter_tools/src/base/context.dart:152:18)
<asynchronous suspension>
#16 FlutterCommand.run (package:flutter_tools/src/runner/flutter_command.dart:415:20)
#17 CommandRunner.runCommand (package:args/command_runner.dart:196:27)
<asynchronous suspension>
#18 FlutterCommandRunner.runCommand.<anonymous closure> (package:flutter_tools/src/runner/flutter_command_runner.dart:396:21)
<asynchronous suspension>
#19 AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:153:29)
<asynchronous suspension>
#20 _rootRun (dart:async/zone.dart:1124:13)
#21 _CustomZone.run (dart:async/zone.dart:1021:19)
#22 _runZoned (dart:async/zone.dart:1516:10)
#23 runZoned (dart:async/zone.dart:1463:12)
#24 AppContext.run (package:flutter_tools/src/base/context.dart:152:18)
<asynchronous suspension>
#25 FlutterCommandRunner.runCommand (package:flutter_tools/src/runner/flutter_command_runner.dart:356:19)
<asynchronous suspension>
#26 CommandRunner.run.<anonymous closure> (package:args/command_runner.dart:111:29)
#27 new Future.sync (dart:async/future.dart:224:31)
#28 CommandRunner.run (package:args/command_runner.dart:111:11)
#29 FlutterCommandRunner.run (package:flutter_tools/src/runner/flutter_command_runner.dart:242:18)
#30 run.<anonymous closure> (package:flutter_tools/runner.dart:60:20)
<asynchronous suspension>
#31 AppContext.run.<anonymous closure> (package:flutter_tools/src/base/context.dart:153:29)
<asynchronous suspension>
#32 _rootRun (dart:async/zone.dart:1124:13)
#33 _CustomZone.run (dart:async/zone.dart:1021:19)
#34 _runZoned (dart:async/zone.dart:1516:10)
#35 runZoned (dart:async/zone.dart:1463:12)
#36 AppContext.run (package:flutter_tools/src/base/context.dart:152:18)
<asynchronous suspension>
#37 runInContext (package:flutter_tools/src/context_runner.dart:54:24)
<asynchronous suspension>
#38 run (package:flutter_tools/runner.dart:51:10)
#39 main (package:flutter_tools/executable.dart:59:9)
<asynchronous suspension>
#40 main (file:///D:/flutter/packages/flutter_tools/bin/flutter_tools.dart:8:3)
#41 _startIsolate.<anonymous closure> (dart:isolate-patch/isolate_patch.dart:298:32)
#42 _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:171:12)

flutter 医生

[✓] Flutter (Channel dev, v1.6.6, on Microsoft Windows [Version 10.0.17134.765], locale en-US)
• Flutter version 1.6.6 at D:\flutter
• Framework revision e1a784ae3f (2 days ago), 2019-05-28 21:53:03 -0700
• Engine revision 8dc3a4cde2
• Dart version 2.3.2 (build 2.3.2-dev.0.0 e3edfd36b2)

[✓] Android toolchain - develop for Android devices (Android SDK version 28.0.3)
• Android SDK at C:\Users\USER\AppData\Local\Android\sdk
• Android NDK location not configured (optional; useful for native profiling support)
• Platform android-28, build-tools 28.0.3
• Java binary at: D:\android\jre\bin\java
• Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1248-b01)
• All Android licenses accepted.

[✓] Android Studio (version 3.3)
• Android Studio at D:\android
• Flutter plugin version 33.3.1
• Dart plugin version 182.5215
• Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1248-b01)

[✓] Connected device (1 available)
• Symphony P7 PRO • B3698Y11HA4122 • android-arm64 • Android 6.0 (API 23)

• No issues found!

我已经尝试过 flutter clean 和 flutter upgrade,但是没有用。

最佳答案

我试图在 vs code 终端中使用命令“flutter create”创建一个 flutter 项目,但我遇到了这个错误

对我有用的是我关闭了 vsCode 并使用 powershell 而不是 vsCode 终端来创建项目谢天谢地它没有显示任何错误

关于flutter - 如何修复 "flutter has exited unexpectedly",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56394520/

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