每当我尝试从vscode运行flutter应用程序时,都会收到错误消息
p
同一应用从android studio运行。 同样在安装后,当我运行命令 flutter doctor 时,我也遇到了问题。 错误在SDK中找不到a帆aapt文件,因此我将aapt2文件复制到同一文件夹中,并使用aapt重命名。
下面,我分享了运行命令 flutter run
时创建的日志文件W/ziparchive( 6116): Unable to open 'xmltree': No such file or directory
xmltree: error:failed to open file: The system cannot find the file specified. (2).
颤抖的医生:
Flutter crash report; please file at https://github.com/flutter/flutter/issues.
command
flutter run
exception
String: Exit code 1 from:
C:\Users\admin\AppData\Local\Android\Sdk\build-tools\28.0.3\aapt dump xmltree E:\Flutter App\first_app\build\app\outputs\apk\app.apk AndroidManifest.xml
#0 _runWithLoggingSync (package:flutter_tools/src/base/process.dart:360:7)
#1 runCheckedSync (package:flutter_tools/src/base/process.dart:289:10)
#2 new AndroidApk.fromApk (package:flutter_tools/src/application_package.dart:120:27)
#3 AndroidApk.fromAndroidProject (package:flutter_tools/src/application_package.dart:158:27)
<asynchronous suspension>
#4 ApplicationPackageFactory.getPackageForPlatform (package:flutter_tools/src/application_package.dart:46:32)
<asynchronous suspension>
#5 FlutterDevice.runHot (package:flutter_tools/src/resident_runner.dart:345:56)
<asynchronous suspension>
#6 HotRunner.run (package:flutter_tools/src/run_hot.dart:253:39)
<asynchronous suspension>
#7 RunCommand.runCommand (package:flutter_tools/src/commands/run.dart:428:
37)
<asynchronous suspension>
#8 FlutterCommand.verifyThenRunCommand (package:flutter_tools/src/runner/flutter_command.dart:559:18)
#9 _asyncThenWrapperHelper.<anonymous closure> (dart:async-patch/async_patch.dart:77:64)
#10 _rootRunUnary (dart:async/zone.dart:1132:38)
#11 _CustomZone.runUnary (dart:async/zone.dart:1029:19)
#12 _FutureListener.handleValue (dart:async/future_impl.dart:126:18)
#13 Future._propagateToListeners.handleValueCallback (dart:async/future_impl.dart:639:45)
#14 Future._propagateToListeners (dart:async/future_impl.dart:668:32)
#15 Future._complete (dart:async/future_impl.dart:473:7)
#16 _SyncCompleter.complete (dart:async/future_impl.dart:51:12)
#17 _AsyncAwaitCompleter.complete (dart:async-patch/async_patch.dart:28:18)
#18 _completeOnAsyncReturn (dart:async-patch/async_patch.dart:294:13)
#19 RunCommand.usageValues (package:flutter_tools/src/commands/run.dart)
#20 _asyncThenWrapperHelper.<anonymous closure> (dart:async-patch/async_patch.dart:77:64)
#21 _rootRunUnary (dart:async/zone.dart:1132:38)
#22 _CustomZone.runUnary (dart:async/zone.dart:1029:19)
#23 _FutureListener.handleValue (dart:async/future_impl.dart:126:18)
#24 Future._propagateToListeners.handleValueCallback (dart:async/future_impl.dart:639:45)
#25 Future._propagateToListeners (dart:async/future_impl.dart:668:32)
#26 Future._complete (dart:async/future_impl.dart:473:7)
#27 _SyncCompleter.complete (dart:async/future_impl.dart:51:12)
#28 _AsyncAwaitCompleter.complete.
<anonymous closure> (dart:async-patch/async_patch.dart:33:20)
#29 _rootRun (dart:async/zone.dart:1124:13)
#30 _CustomZone.run (dart:async/zone.dart:1021:19)
#31 _CustomZone.bindCallback.<anonymous closure> (dart:async/zone.dart:947:23)
#32 _microtaskLoop (dart:async/schedule_microtask.dart:41:21)
#33 _startMicrotaskLoop (dart:async/schedule_microtask.dart:50:5)
#34 _runPendingImmediateCallback (dart:isolate-patch/isolate_patch.dart:115:13)
#35 _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:172:5)
我正在使用真实设备进行测试。
答案 0 :(得分:0)
谢谢@BarryWang的帮助。 我通过将Android SDk版本从28 API升级到29解决了这个问题。
答案 1 :(得分:0)
我已经尽力了,对我有用。
您遇到的问题是C:\ Users \ admin \ AppData \ Local \ Android \ Sdk \ build-tools \ 28.0.3 \文件中的aapt.exe
尝试手动执行该命令,大多数情况下会出现DLL文件丢失的错误
祝你好运