簡體   English   中英

在不使用 android 工作室的情況下嘗試接受 android 許可證時未找到 android sdk

[英]android sdk not found when trying to accept android license without the use of android studio

我正在嘗試學習 flutter,但我偶然發現了安裝問題,一切正常,直到我運行 flutter 醫生,它聲明我必須接受 android 許可證。

請記住,我在沒有 Android Studio的情況下工作,所以我正在尋找一種不包含需要 android Studio 的修復的解決方案

有很多人有同樣的問題,但我看到的幾乎所有修復都包括 android studio

我單獨安裝了命令行工具並將其安裝在我的 sdk 文件夾中,我這樣做是因為我不想使用 android studio,而是使用 visual studio 來處理 flutter 中的工作。

[√] Flutter (Channel stable, 3.3.10, on Microsoft Windows [Version 10.0.19044.2364], locale de-DE)
[!] Android toolchain - develop for Android devices (Android SDK version 33.0.0)
    X Android license status unknown.
      Run `flutter doctor --android-licenses` to accept the SDK licenses.
      See https://flutter.dev/docs/get-started/install/windows#android-setup for more details.
[√] Chrome - develop for the web
[√] Visual Studio - develop for Windows (Visual Studio Community 2022 17.1.4)
[!] Android Studio (not installed)
[√] VS Code (version 1.74.2)
[√] Connected device (3 available)
[√] HTTP Host Availability

當我嘗試接受許可證時,我的 Output:

C:\Users\Tim\AppData\Local\Android\Sdk\cmdline-tools\bin>flutter doctor --android-licenses
Android sdkmanager not found. Update to the latest Android SDK and ensure that the cmdline-tools are installed to resolve this.

我已經嘗試通過 flutter 配置移動我的 sdk 路徑重新安裝 cmdline-tools 更新 cmdline 工具的路徑尋找更新或更新版本

如果有人想查看所有版本,這是我運行 flutter doctor -v 時的 output

C:\Users\Tim\AppData\Local\Android\Sdk\cmdline-tools\bin>flutter doctor -v
[√] Flutter (Channel stable, 3.3.10, on Microsoft Windows [Version 10.0.19044.2364], locale de-DE)
    • Flutter version 3.3.10 on channel stable at C:\Users\Tim\flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 135454af32 (10 days ago), 2022-12-15 07:36:55 -0800
    • Engine revision 3316dd8728
    • Dart version 2.18.6
    • DevTools version 2.15.0

[!] Android toolchain - develop for Android devices (Android SDK version 33.0.0)
    • Android SDK at C:\Users\Tim\AppData\Local\Android\Sdk
    • Platform android-33, build-tools 33.0.0
    • Java binary at: C:\Program Files\Common Files\Oracle\Java\javapath\java.exe
    • Java version Java(TM) SE Runtime Environment (build 18.0.2.1+1-1)
    X Android license status unknown.
      Run `flutter doctor --android-licenses` to accept the SDK licenses.
      See https://flutter.dev/docs/get-started/install/windows#android-setup for more details.

[√] Chrome - develop for the web
    • Chrome at C:\Program Files\Google\Chrome\Application\chrome.exe

[√] Visual Studio - develop for Windows (Visual Studio Community 2022 17.1.4)
    • Visual Studio at C:\Program Files\Microsoft Visual Studio\2022\Community
    • Visual Studio Community 2022 version 17.1.32407.343
    • Windows 10 SDK version 10.0.19041.0

[!] Android Studio (not installed)
    • Android Studio not found; download from https://developer.android.com/studio/index.html
      (or visit https://flutter.dev/docs/get-started/install/windows#android-setup for detailed instructions).

[√] VS Code (version 1.74.2)
    • VS Code at C:\Users\Tim\AppData\Local\Programs\Microsoft VS Code
    • Flutter extension can be installed from:
       https://marketplace.visualstudio.com/items?itemName=Dart-Code.flutter

[√] Connected device (3 available)
    • Windows (desktop) • windows • windows-x64    • Microsoft Windows [Version 10.0.19044.2364]
    • Chrome (web)      • chrome  • web-javascript • Google Chrome 108.0.5359.125
    • Edge (web)        • edge    • web-javascript • Microsoft Edge 108.0.1462.54

[√] HTTP Host Availability
    • All required HTTP hosts are available

! Doctor found issues in 2 categories.

請記住,問題之一是未安裝 android studio,但沒有它應該可以正常工作,因此從技術上講存在一個問題

我的文件目錄的圖像,因為我不確定哪些文件夾實際上屬於該目錄:C:\Users\Tim\AppData\Local\Android\Sdk\cmdline-tools

我的 cmdline tools 文件夾中有另一個 cmdline tools 文件夾是否正常,它包含最新的文件夾

或者最新的文件夾應該直接在 cmdline 工具中

將系統環境變量中的 PATH 變量更新為 sdkmanager 所在的位置。

要執行此操作:Go 到 Windows > 搜索環境變量> go 到“編輯系統環境變量”> 創建一個新變量或添加到現有的 PATH 變量為“C:\Users\Tim\AppData\Local\Android\Sdk\cmdline -工具\最新\bin"

然后重新啟動命令提示符,然后鍵入 flutter doctor --android-licenses

單擊 y 或 Yes 接受所有策略

然后運行 flutter doctor -v 檢查問題是否解決

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM