【发布时间】:2021-12-29 04:32:12
【问题描述】:
我的模拟器有问题,我无法在上面运行我的应用程序。几个月前,我仍然可以打开我的旧项目并在模拟器上运行它们。几个月后,我带着一个新项目回来了,现在我可以打开模拟器,但它与我的项目没有连接(也与我的旧项目)。
我看到当我打开模拟器时出现错误提示 faild to start adb 并且另一个通知显示 daemon is terminated。我在谷歌上搜索这些以找到解决方案,但没有任何帮助。
这是我的flutter doctor -v
or found issues in 3 categories.
Macbooks-MacBook-Pro-3:learning_bee quanan$ flutter doctor -v
[✓] Flutter (Channel dev, 2.3.0-24.0.pre, on Mac OS X 10.14.6 18G2022 darwin-x64, locale en-US)
• Flutter version 2.3.0-24.0.pre at /Users/quanan/Downloads/flutter
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision 2b9537c783 (5 months ago), 2021-06-11 22:11:53 -0700
• Engine revision ddbac024d1
• Dart version 2.14.0 (build 2.14.0-188.0.dev)
[✓] Android toolchain - develop for Android devices (Android SDK version 31.0.0)
• Android SDK at /Users/quanan/Library/Android/sdk
• Platform android-30, build-tools 31.0.0
• Java binary at: /Library/Java/JavaVirtualMachines/jdk1.8.0_271.jdk/Contents/Home/bin/java
• Java version Java(TM) SE Runtime Environment (build 1.8.0_271-b09)
• All Android licenses accepted.
[!] Xcode - develop for iOS and macOS
✗ Xcode installation is incomplete; a full installation is necessary for iOS development.
Download at: https://developer.apple.com/xcode/download/
Or install Xcode via the App Store.
Once installed, run:
sudo xcode-select --switch /Applications/Xcode.app/Contents/Developer
sudo xcodebuild -runFirstLaunch
! CocoaPods 1.9.3 out of date (1.10.0 is recommended).
CocoaPods is used to retrieve the iOS and macOS platform side's plugin code that responds to your plugin usage on the Dart side.
Without CocoaPods, plugins will not work on iOS or macOS.
For more info, see https://flutter.dev/platform-plugins
To upgrade see https://guides.cocoapods.org/using/getting-started.html#installation for instructions.
[✓] Chrome - develop for the web
• Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome
[!] Android Studio (version 2020.3)
• Android Studio at /Applications/Android Studio.app/Contents
• Flutter plugin can be installed from:
???? https://plugins.jetbrains.com/plugin/9212-flutter
• Dart plugin can be installed from:
???? https://plugins.jetbrains.com/plugin/6351-dart
✗ Unable to find bundled Java version.
• Try updating or re-installing Android Studio.
[✓] VS Code (version 1.62.2)
• VS Code at /Applications/Visual Studio Code.app/Contents
• Flutter extension can be installed from:
???? https://marketplace.visualstudio.com/items?itemName=Dart-Code.flutter
[☠] Connected device (the doctor check crashed)
✗ Due to an error, the doctor check did not complete. If the error message below is not helpful, please let us know about this issue at
https://github.com/flutter/flutter/issues.
✗ Exception: Unable to run "adb", check your Android SDK installation and ANDROID_SDK_ROOT environment variable:
/Users/quanan/Library/Android/sdk/platform-tools/adb
• #0 throwToolExit (package:flutter_tools/src/base/common.dart:10:3)
#1 AndroidDevices.pollingGetDevices (package:flutter_tools/src/android/android_device_discovery.dart:78:7)
<asynchronous suspension>
#2 PollingDeviceDiscovery._populateDevices (package:flutter_tools/src/device.dart:397:54)
<asynchronous suspension>
#3 Future.wait.<anonymous closure> (dart:async/future.dart)
<asynchronous suspension>
#4 DeviceManager.getAllConnectedDevices (package:flutter_tools/src/device.dart:163:40)
<asynchronous suspension>
#5 DeviceValidator.validate (package:flutter_tools/src/doctor.dart:515:34)
<asynchronous suspension>
#6 asyncGuard.<anonymous closure> (package:flutter_tools/src/base/async_guard.dart:111:24)
<asynchronous suspension>
! Doctor found issues in 3 categories.
由于我的 SSD 只有 125GB 左右,一年前我不得不删除 Xcode 和所有 ios 模拟器,因此出现错误的 Xcode 部分很好。
如果我没记错的话,我的应用程序在模拟器上仍然可以正常运行,我仍然会看到Flutter daemon terminated 的错误消息,但它仍然可以正常运行,所以我认为这不会是错误。当我打开 android studio 时发生此错误
【问题讨论】:
-
'找不到捆绑的 Java 版本'。也许,你应该看看这里。
-
我点击了链接,它解决了 '无法找到捆绑的 Java 版本',但它仍然无法在模拟器上运行我的应用程序
标签: flutter android-studio adb daemon