首页 > 解决方案 > 无法找到 android sdk Flutter Mac

问题描述

我是颤振的新用户,我安装了 android studio 和颤振插件。在运行我的颤振医生 -v 时它显示。我不知道如何解决它。帮帮我。我尝试了很多来修复它,但没有任何帮助

[✗] Android toolchain - develop for Android devices
    ✗ Unable to locate Android SDK.
      Install Android Studio from:
      https://developer.android.com/studio/index.html
      On first launch it will assist you in installing the Android SDK
      components.
      (or visit https://flutter.dev/docs/get-started/install/macos#android-setup
      for detailed instructions).
      If the Android SDK has been installed to a custom location, set
      ANDROID_SDK_ROOT to that location.
      You may also want to add it to your PATH environment variable.


[✗] 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 not installed.
        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 install:
        sudo gem install cocoapods

[✓] Android Studio (version 3.3)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin version 34.0.1
    • Dart plugin version 182.5215
    • Java version OpenJDK Runtime Environment (build
      1.8.0_152-release-1248-b01)

[!] Android Studio
    • Android Studio at /Users/apple/Developer/flutter/Contents
    ✗ Flutter plugin not installed; this adds Flutter specific functionality.
    ✗ Dart plugin not installed; this adds Dart specific functionality.
    ✗ Android Studio not found at /Users/apple/Developer/flutter/Contents
    • Try updating or re-installing Android Studio.

[!] Connected device
    ! No devices available

标签: android-studioflutter

解决方案


您的项目中是否存在 local.properties 文件,在 android 文件夹内?

在此处输入图像描述

如果不是,则创建一个 local.properties 文件并将您的 android sdk 路径放入其中,就像我的情况一样

sdk.dir=/Users/tusharpandey/Library/Android/sdk

推荐阅读