gpt4 book ai didi

即使模拟器打开也没有检测到任何设备

转载 作者:行者123 更新时间:2023-12-04 17:43:24 25 4
gpt4 key购买 nike

我是 flutter 项目开发的新手,最近我遇到了一个技术问题,即使模拟器打开,flutter 也无法检测到 android 模拟器;问题如下: enter image description here

Flutter console:
F:\Developer\demo>flutter doctor -v
[√] Flutter (Channel beta, v0.7.3, on Microsoft Windows [Version 10.0.17134.228], locale zh-CN)
• Flutter version 0.7.3 at D:\flutter_windows_v0.7.3-beta\flutter
• Framework revision 3b309bda07 (3 months ago), 2018-08-28 12:39:24 -0700
• Engine revision af42b6dc95
• Dart version 2.1.0-dev.1.0.flutter-ccb16f7282

[√] Android toolchain - develop for Android devices (Android SDK 28.0.3)
• Android SDK at D:\Android\android-sdk-windows
• Android NDK location not configured (optional; useful for native profiling support)
• Platform android-28, build-tools 28.0.3
• ANDROID_HOME = D:\Android\android-sdk-windows
• Java binary at: D:\Program Files\Android\Android Studio\jre\bin\java
• Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1024-b02)
• All Android licenses accepted.

[√] Android Studio (version 3.1)
• Android Studio at D:\Program Files\Android\Android Studio
• Flutter plugin version 28.0.1
• Dart plugin version 173.4700
• Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1024-b02)

[!] Connected devices
! No devices available

! Doctor found issues in 1 category.

那么,我有什么地方出错了吗?

最佳答案

首先检查您的设备是否已列出:

In terminal, run the flutter devices command to verify that Flutterrecognizes your connected Android device.

您可以按照 Flutter 文档中提供的安装指南进行操作:

Windows set-up

Install AndroidStudio

  1. Download and install Android Studio.
  2. Start Android Studio, and go through the ‘Android Studio Setup Wizard’. This installs the latest Android SDK, Android SDKCommand-line Tools, and Android SDK Build-Tools, which are required byFlutter when developing for Android.

Set up your Androiddevice

To prepare to run and test your Flutter app on an Android device, youneed an Android device running Android 4.1 (API level 16) or higher.

  1. Enable Developer options and USB debugging on your device. Detailed instructions are available in the Androiddocumentation.
  2. Windows-only: Install the Google USB Driver.
  3. Using a USB cable, plug your phone into your computer. If prompted on your device, authorize your computer to access your device.
  4. n the terminal, run the flutter devices command to verify that Flutter recognizes your connected Android device. By default, Flutteruses the version of the Android SDK where your adb tool is based. Ifyou want Flutter to use a different installation of the Android SDK,you must set the ANDROID_SDK_ROOT environment variable to thatinstallation directory.

Set up the Androidemulator

To prepare to run and test your Flutter app on the Android emulator,follow these steps:

  1. Enable VMaccelerationon your machine.

  2. Launch Android Studio, click the AVD Manager icon, and select CreateVirtual Device…

    • In older versions of Android Studio, you should instead launch Android Studio > Tools > Android > AVD Manager and select Create Virtual Device…. (The Android submenu is only present wheninside an Android project.)
    • If you do not have a project open, you can choose Configure > AVD Manager and select Create Virtual Device…
  3. Choose a device definition and select Next.

  4. Select one or more system images for the Android versions you want to emulate, and select Next. An x86 or x86_64 image isrecommended.

  5. Under Emulated Performance, select Hardware - GLES 2.0 to enable hardwareacceleration.

  6. Verify the AVD configuration is correct, and select Finish.

    For details on the above steps, see Managing AVDs.

  7. In Android Virtual Device Manager, click Run in the toolbar. The emulator starts up and displays the default canvas for yourselected OS version and device.

尝试检查这个 SO post以及。这与你的问题有关。

关于即使模拟器打开也没有检测到任何设备,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53357266/

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