flutter doctor --android-licenses A newer version of the Android SDK is required. To update, run: /U

检测本机环境依赖, 执行 $ flutter doctor

Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, v1.0.0, on Mac OS X 10.14 18A391, locale zh-Hans-CN)
[!] Android toolchain - develop for Android devices (Android SDK 28.0.3)
    ✗ Android license status unknown.
[!] iOS toolchain - develop for iOS devices (Xcode 10.1)
    ✗ libimobiledevice and ideviceinstaller are not installed. To install with Brew,
      run:
        brew update
        brew install --HEAD usbmuxd
        brew link usbmuxd
        brew install --HEAD libimobiledevice
        brew install ideviceinstaller
    ✗ ios-deploy not installed. To install with Brew:
        brew install ios-deploy
    ! CocoaPods out of date (1.5.0 is recommended).
        CocoaPods is used to retrieve the iOS platform side's plugin code that
        responds to your plugin usage on the Dart side.
        Without resolving iOS dependencies with CocoaPods, plugins will not work on
        iOS.
        For more info, see https://flutter.io/platform-plugins
      To upgrade:
        brew upgrade cocoapods
        pod setup
[✓] Android Studio (version 3.2)
[!] VS Code (version 1.24.1)
[!] Connected device
    ! No devices available

! Doctor found issues in 4 categories.

1.难解决的: ✗ Android license status unknown , 执行命令?

$ flutter doctor --android-licenses
A newer version of the Android SDK is required. To update, run:
/Users/zhaoyang/Library/Android/sdk/tools/bin/sdkmanager --update

根据上面提示执行命令?,有报错

$ /Users/zhaoyang/Library/Android/sdk/tools/bin/sdkmanager --update
Exception in thread "main" java.lang.NoClassDefFoundError: javax/xml/bind/annotation/XmlSchema
    at com.android.repository.api.SchemaModule$SchemaModuleVersion.<init>(SchemaModule.java:156)
    at com.android.repository.api.SchemaModule.<init>(SchemaModule.java:75)
    at com.android.sdklib.repository.AndroidSdkHandler.<clinit>(AndroidSdkHandler.java:81)
    at com.android.sdklib.tool.sdkmanager.SdkManagerCli.main(SdkManagerCli.java:73)
    at com.android.sdklib.tool.sdkmanager.SdkManagerCli.main(SdkManagerCli.java:48)
Caused by: java.lang.ClassNotFoundException: javax.xml.bind.annotation.XmlSchema
    at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:582)
    at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:190)
    at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:499)
    ... 5 more

根据搜索javax.xml.bind.JAXBException问题发现缺了包maven
>>>> 以下方式解决:

$ brew install maven
Updating Homebrew...
==> Auto-updated Homebrew!
Updated 1 tap (homebrew/core).
==> New Formulae
istioctl                                   kubeseal                                   pass-otp
==> Updated Formulae
glib ✔               babel                embulk               imagemagick          minio                r
graphite2 ✔          bison                exploitdb            jhipster             minio-mc             rust
harfbuzz ✔           blackbox             fluxctl              jsonnet              nsd                  skopeo
vala ✔               citus                fn                   libcerf              paket                unbound
ammonite-repl        conan                gauche               libcouchbase         pdfpc                vice
annie                container-diff       gdal                 lmdb                 percona-server       webpack
antlr4-cpp-runtime   dnscontrol           gnu-sed              mas                  php-code-sniffer     z3
awscli               docfx                grep                 micronaut            pre-commit

==> Downloading https://www.apache.org/dyn/closer.cgi?path=maven/maven-3/3.6.0/binaries/apache-maven-3.6.0-bin.tar.gz
==> Downloading from http://mirrors.hust.edu.cn/apache/maven/maven-3/3.6.0/binaries/apache-maven-3.6.0-bin.tar.gz
######################################################################## 100.0%
?  /usr/local/Cellar/maven/3.6.0: 79 files, 10.1MB, built in 1 minute 31 seconds

再执行下/Users/zhaoyang/Library/Android/sdk/tools/bin/sdkmanager --update

$ /Users/zhaoyang/Library/Android/sdk/tools/bin/sdkmanager --update
Warning: File /Users/zhaoyang/.android/repositories.cfg could not be loaded. 

然后 Android license 解决了 难点

$ flutter doctor
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, v1.0.0, on Mac OS X 10.14 18A391, locale zh-Hans-CN)
[!] Android toolchain - develop for Android devices (Android SDK 28.0.3)
    ! Some Android licenses not accepted.  To resolve this, run: flutter doctor --android-licenses
[!] iOS toolchain - develop for iOS devices (Xcode 10.1)
    ✗ libimobiledevice and ideviceinstaller are not installed. To install with Brew, run:
        brew update
        brew install --HEAD usbmuxd
        brew link usbmuxd
        brew install --HEAD libimobiledevice
        brew install ideviceinstaller
    ✗ ios-deploy not installed. To install with Brew:
        brew install ios-deploy
    ! CocoaPods out of date (1.5.0 is recommended).
        CocoaPods is used to retrieve the iOS platform side's plugin code that responds to your plugin usage on the Dart side.
        Without resolving iOS dependencies with CocoaPods, plugins will not work on iOS.
        For more info, see https://flutter.io/platform-plugins
      To upgrade:
        brew upgrade cocoapods
        pod setup
[✓] Android Studio (version 3.2)
[!] VS Code (version 1.24.1)
[!] Connected device
    ! No devices available

! Doctor found issues in 4 categories.

后面比较顺利,接着走 就行

$ flutter doctor --android-licenses
Warning: File /Users/zhaoyang/.android/repositories.cfg could not be loaded.    
4 of 6 SDK package licenses not accepted. 100% Computing updates...             
Review licenses that have not been accepted (y/N)? y

1/4: License android-googletv-license:
---------------------------------------
Terms and Conditions
...

Android license解决好,后面都好说了?

$ flutter doctor
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, v1.0.0, on Mac OS X 10.14 18A391, locale zh-Hans-CN)
[✓] Android toolchain - develop for Android devices (Android SDK 28.0.3)
[!] iOS toolchain - develop for iOS devices (Xcode 10.1)
    ✗ libimobiledevice and ideviceinstaller are not installed. To install with Brew, run:
        brew update
        brew install --HEAD usbmuxd
        brew link usbmuxd
        brew install --HEAD libimobiledevice
        brew install ideviceinstaller
    ✗ ios-deploy not installed. To install with Brew:
        brew install ios-deploy
    ! CocoaPods out of date (1.5.0 is recommended).
        CocoaPods is used to retrieve the iOS platform side's plugin code that responds to your plugin usage on the Dart side.
        Without resolving iOS dependencies with CocoaPods, plugins will not work on iOS.
        For more info, see https://flutter.io/platform-plugins
      To upgrade:
        brew upgrade cocoapods
        pod setup
[✓] Android Studio (version 3.2)
[!] VS Code (version 1.24.1)
[!] Connected device
    ! No devices available

! Doctor found issues in 3 categories.

然后,一步步 没啥意外了

$ flutter doctor
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, v1.0.0, on Mac OS X 10.14 18A391, locale
    zh-Hans-CN)
[✓] Android toolchain - develop for Android devices (Android SDK 28.0.3)
[✓] iOS toolchain - develop for iOS devices (Xcode 10.1)
[✓] Android Studio (version 3.2)
[!] VS Code (version 1.24.1)
[!] Connected device
    ! No devices available

! Doctor found issues in 2 categories.

brew upgrade cocoapods时,我遇到Error: cocoapods not installed问题,那就安装一遍cocoapods。可能又遇到bad response Not Found 404?解决ruby源问题

2. 咋使用上sdkmanager命令行, 待解决

$ sdkmanager --list
-bash: sdkmanager: command not found

 介绍一款好用的工具,你懂的:加速器(需要的自选,可以那什么访问)-其它文档类资源-CSDN下载加速器,有安卓、Mac、windows版本,解压后,选择相应版本使用。更多下载资源、学习资料请访问CSDN下载频道.https://download.csdn.net/download/a787188834/57062447

  • 3
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值