将工作项目升级到 Flutter_2 并运行它时,出现以下错误。
根据类似问题的回答,Avd Data(Pixel_3a)已
wiped
。
如何解决这个问题?
错误
Can't find service: package / Can't find service: activity
完全错误
Launching lib\forms\validateForm1.dart on sdk gphone x86 arm in debug mode...
Running Gradle task 'assembleDebug'...
√ Built build\app\outputs\flutter-apk\app-debug.apk.
cmd: Can't find service: activity
Installing build\app\outputs\flutter-apk\app.apk...
Error: ADB exited with exit code 1
Performing Streamed Install
adb: failed to install F:\Script\Flutter\myapp\build\app\outputs\flutter-apk\app.apk: cmd: Can't find service: package
Error launching application on sdk gphone x86 arm.
颤动医生
Doctor summary (to see all details, run flutter doctor -v):
[√] Flutter (Channel dev, 2.1.0-10.0.pre, on Microsoft Windows [Version 10.0.18363.1379], locale en-US)
[√] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
[X] Chrome - develop for the web (Cannot find Chrome executable at .\Google\Chrome\Application\chrome.exe)
! Cannot find Chrome. Try setting CHROME_EXECUTABLE to a Chrome executable.
[√] Visual Studio - develop for Windows (Visual Studio Community 2019 16.8.3)
[√] Android Studio (version 4.1.0)
[√] VS Code (version 1.54.1)
[√] Connected device (2 available)
删除 Avd 相关的
lock files
解决了问题。
打开 Avd Manager -> ShowonDisk -> 从磁盘删除以下 2 个锁定文件 --->
硬件-qemu 和 multiinstance.lock
为我解决这个问题的技巧是对模拟设备进行冷启动。 您可以从设备管理器中执行此操作。