Flutter 环境问题

关键字

! No devices available
Error: No such keg: /usr/local/Cellar/libimobiledevice
Warning: usbmuxd HEAD-c75605d_1 is already installed and up-to-date
To reinstall HEAD_1, run brew reinstall usbmuxd


➜  ~ flutter doctor -v
[✓] Flutter (Channel master, v1.2.1-pre.194, on Mac OS X 10.14.3 18D109, locale
    zh-Hans-CN)
    • Flutter version 1.2.1-pre.194 at /Users/conan/flutter_sdk/flutter
    • Framework revision 537b592ed5 (20 hours ago), 2019-02-13 20:17:28 -0800
    • Engine revision d48de7a3ec
    • Dart version 2.1.2 (build 2.1.2-dev.0.0 fdfe40ea95)

[✓] Android toolchain - develop for Android devices (Android SDK version 28.0.3)
    • Android SDK at /Users/conan/Library/Android/sdk
    • Android NDK location not configured (optional; useful for native profiling
      support)
    • Platform android-28, build-tools 28.0.3
    • Java binary at: /Applications/Android
      Studio.app/Contents/jre/jdk/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build
      1.8.0_152-release-1248-b01)
    • All Android licenses accepted.

[!] iOS toolchain - develop for iOS devices (Xcode 10.1)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Xcode 10.1, Build version 10B61
    ✗ 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 1.9.4
    • CocoaPods version 1.6.0

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

[!] IntelliJ IDEA Ultimate Edition (version 2018.3.4)
    • IntelliJ at /Applications/IntelliJ IDEA.app
    ✗ Flutter plugin not installed; this adds Flutter specific functionality.
    ✗ Dart plugin not installed; this adds Dart specific functionality.
    • For information about installing plugins, see
      https://flutter.io/intellij-setup/#installing-the-plugins

[!] Connected device
    ! No devices available

! Doctor found issues in 3 categories.

由于手残将电脑重装了,导致环境得重新配置,sdk更新了几次之后好像也出现过找不到设备的问题,现在统一解决了,特地记录下,免得自己忘记,如果有遇到和我一样问题的,可以尝试下试试。

出现上面的问题,正常按照提示输入命令应该就可以解决问题,但是本人电脑就是不行; 下面是记录,最后也会给出总结。

运行这个命令的时候 出现如下warning ,紧接着运行brew reinstall usbmuxd 也并没有什么作用
➜  ~ brew install --HEAD usbmuxd
Warning: usbmuxd HEAD-c75605d_1 is already installed and up-to-date
To reinstall HEAD_1, run `brew reinstall usbmuxd`

完整的命令和日志:

➜  ~ brew install --HEAD usbmuxd
Warning: usbmuxd HEAD-c75605d_1 is already installed and up-to-date
To reinstall HEAD_1, run `brew reinstall usbmuxd`

➜  ~ brew reinstall usbmuxd
==> Reinstalling usbmuxd 
==> Cloning https://git.sukimashita.com/libusbmuxd.git
Updating /Users/conan/Library/Caches/Homebrew/usbmuxd--git
==> Checking out branch master
Already on 'master'
Your branch is up to date with 'origin/master'.
HEAD is now at c75605d Return meaningful error codes from usbmuxd_connect()
==> ./autogen.sh
==> ./configure --disable-silent-rules --prefix=/usr/local/Cellar/usbmuxd/HEAD-c
==> make install
🍺  /usr/local/Cellar/usbmuxd/HEAD-c75605d_1: 13 files, 138.1KB, built in 54 seconds

➜  ~ brew install --HEAD usbmuxd
Warning: usbmuxd HEAD-c75605d_1 is already installed and up-to-date
To reinstall HEAD_1, run `brew reinstall usbmuxd`
➜  ~ 

上面出现的情况,发现使用提示去操作并无任何作用,最后在Github flutter issues上找到了解决办法.

总结解决 连接iOS 设备问题:

        brew update
        brew install --HEAD usbmuxd
        brew unlink usbmuxd  //解决我的问题的关键命令
        brew link usbmuxd
        brew install --HEAD libimobiledevice
        brew install ideviceinstaller

最终结果

➜  ~ flutter doctor
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel master, v1.2.1-pre.194, on Mac OS X 10.14.3 18D109, locale
    zh-Hans-CN)
[✓] Android toolchain - develop for Android devices (Android SDK version 28.0.3)
[✓] iOS toolchain - develop for iOS devices (Xcode 10.1)
[✓] Android Studio (version 3.3)
[✓] IntelliJ IDEA Ultimate Edition (version 2018.2.7)
[✓] Connected device (1 available)

• No issues found!

iOS toolchain: 运行到iOS真机设备需要开发者证书
IntelliJ IDEA:破解方法

2019 03-20 补充异常问题
对于之前安装过,后面更新又出现问题的情况,这里记录些自己遇到的现象,和解决办法;经过经历这么多问题,感觉flutter 的文档还是特别好用的,安装有问题都有提示,提示你该怎么操作;
问题一:libimobiledevice--git clone 不了

==> Summary
🍺  /usr/local/Cellar/libxml2/2.9.9_2: 281 files, 10.5MB
==> Installing libimobiledevice --HEAD
==> Cloning https://git.libimobiledevice.org/libimobiledevice.git
Cloning into '/Users/zhangwenhao/Library/Caches/Homebrew/libimobiledevice--git'...
fatal: unable to access 'https://git.libimobiledevice.org/libimobiledevice.git/': Empty reply from server
Error: An exception occurred within a child process:
  DownloadError: Failed to download resource "libimobiledevice"
Failure while executing; `git clone --branch master https://git.libimobiledevice.org/libimobiledevice.git /Users/zhangwenhao/Library/Caches/Homebrew/libimobiledevice--git` exited with 128. Here's the output:
Cloning into '/Users/zhangwenhao/Library/Caches/Homebrew/libimobiledevice--git'...
fatal: unable to access 'https://git.libimobiledevice.org/libimobiledevice.git/': Empty reply from server



➜  ~ /Users/zhangwenhao/Library/Caches/Homebrew/
➜  Homebrew ls    

解决办法:自己手动clone ,这里出现这个问题的原因是 github 上面该仓库换了路径;

➜  Homebrew git clone https://github.com/libimobiledevice/libimobiledevice.git libimobiledevice--git
Cloning into 'libimobiledevice--git'...
remote: Enumerating objects: 27, done.
remote: Counting objects: 100% (27/27), done.
remote: Compressing objects: 100% (16/16), done.
remote: Total 8261 (delta 14), reused 18 (delta 11), pack-reused 8234
Receiving objects: 100% (8261/8261), 2.56 MiB | 1.73 MiB/s, done. 
Resolving deltas: 100% (5793/5793), done.
➜  Homebrew cd  

后面再接着前面的操作继续;

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
  • 序言:七十年代末,一起剥皮案震惊了整个滨河市,随后出现的几起案子,更是在滨河造成了极大的恐慌,老刑警刘岩,带你破解...
    沈念sama阅读 214,658评论 6 496
  • 序言:滨河连续发生了三起死亡事件,死亡现场离奇诡异,居然都是意外死亡,警方通过查阅死者的电脑和手机,发现死者居然都...
    沈念sama阅读 91,482评论 3 389
  • 文/潘晓璐 我一进店门,熙熙楼的掌柜王于贵愁眉苦脸地迎上来,“玉大人,你说我怎么就摊上这事。” “怎么了?”我有些...
    开封第一讲书人阅读 160,213评论 0 350
  • 文/不坏的土叔 我叫张陵,是天一观的道长。 经常有香客问我,道长,这世上最难降的妖魔是什么? 我笑而不...
    开封第一讲书人阅读 57,395评论 1 288
  • 正文 为了忘掉前任,我火速办了婚礼,结果婚礼上,老公的妹妹穿的比我还像新娘。我一直安慰自己,他们只是感情好,可当我...
    茶点故事阅读 66,487评论 6 386
  • 文/花漫 我一把揭开白布。 她就那样静静地躺着,像睡着了一般。 火红的嫁衣衬着肌肤如雪。 梳的纹丝不乱的头发上,一...
    开封第一讲书人阅读 50,523评论 1 293
  • 那天,我揣着相机与录音,去河边找鬼。 笑死,一个胖子当着我的面吹牛,可吹牛的内容都是我干的。 我是一名探鬼主播,决...
    沈念sama阅读 39,525评论 3 414
  • 文/苍兰香墨 我猛地睁开眼,长吁一口气:“原来是场噩梦啊……” “哼!你这毒妇竟也来了?” 一声冷哼从身侧响起,我...
    开封第一讲书人阅读 38,300评论 0 270
  • 序言:老挝万荣一对情侣失踪,失踪者是张志新(化名)和其女友刘颖,没想到半个月后,有当地人在树林里发现了一具尸体,经...
    沈念sama阅读 44,753评论 1 307
  • 正文 独居荒郊野岭守林人离奇死亡,尸身上长有42处带血的脓包…… 初始之章·张勋 以下内容为张勋视角 年9月15日...
    茶点故事阅读 37,048评论 2 330
  • 正文 我和宋清朗相恋三年,在试婚纱的时候发现自己被绿了。 大学时的朋友给我发了我未婚夫和他白月光在一起吃饭的照片。...
    茶点故事阅读 39,223评论 1 343
  • 序言:一个原本活蹦乱跳的男人离奇死亡,死状恐怖,灵堂内的尸体忽然破棺而出,到底是诈尸还是另有隐情,我是刑警宁泽,带...
    沈念sama阅读 34,905评论 5 338
  • 正文 年R本政府宣布,位于F岛的核电站,受9级特大地震影响,放射性物质发生泄漏。R本人自食恶果不足惜,却给世界环境...
    茶点故事阅读 40,541评论 3 322
  • 文/蒙蒙 一、第九天 我趴在偏房一处隐蔽的房顶上张望。 院中可真热闹,春花似锦、人声如沸。这庄子的主人今日做“春日...
    开封第一讲书人阅读 31,168评论 0 21
  • 文/苍兰香墨 我抬头看了看天上的太阳。三九已至,却和暖如春,着一层夹袄步出监牢的瞬间,已是汗流浃背。 一阵脚步声响...
    开封第一讲书人阅读 32,417评论 1 268
  • 我被黑心中介骗来泰国打工, 没想到刚下飞机就差点儿被人妖公主榨干…… 1. 我叫王不留,地道东北人。 一个月前我还...
    沈念sama阅读 47,094评论 2 365
  • 正文 我出身青楼,却偏偏与公主长得像,于是被迫代替她去往敌国和亲。 传闻我的和亲对象是个残疾皇子,可洞房花烛夜当晚...
    茶点故事阅读 44,088评论 2 352

推荐阅读更多精彩内容