Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

flutter doctor returns [Unhandled exception: Exception: idevice_id returned an error] #23455

Closed
Hanggi opened this issue Oct 24, 2018 · 24 comments
Labels
c: crash Stack traces logged to the console platform-mac Building on or for macOS specifically t: flutter doctor Problem related to the "flutter doctor" tool tool Affects the "flutter" command-line tool. See also t: labels.

Comments

@Hanggi
Copy link

Hanggi commented Oct 24, 2018

I ran the flutter doctor, there were some brew install items, after install these items I got this problem:

$ flutter doctor
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel beta, v0.9.4, on Mac OS X 10.14 18A391, locale zh-Hans-CN)
Unhandled exception:
Exception: idevice_id returned an error:

#0      IMobileDevice.getInfoForDevice (package:flutter_tools/src/ios/mac.dart:122:9)
<asynchronous suspension>
#1      IOSDevice.getAttachedDevices (package:flutter_tools/src/ios/devices.dart:152:53)
<asynchronous suspension>
#2      IOSDevices.pollingGetDevices (package:flutter_tools/src/ios/devices.dart:112:57)
#3      PollingDeviceDiscovery.devices (package:flutter_tools/src/device.dart:163:52)
<asynchronous suspension>
#4      DeviceManager.getAllConnectedDevices (package:flutter_tools/src/device.dart:91:46)
<asynchronous suspension>
#5      DeviceValidator.validate (package:flutter_tools/src/doctor.dart:607:54)
<asynchronous suspension>
#6      Doctor.startValidatorTasks (package:flutter_tools/src/doctor.dart:105:52)
#7      Doctor.diagnose (package:flutter_tools/src/doctor.dart:162:41)
#8      _AsyncAwaitCompleter.start (dart:async/runtime/libasync_patch.dart:49:6)
#9      Doctor.diagnose (package:flutter_tools/src/doctor.dart:152:24)
#10     DoctorCommand.runCommand (package:flutter_tools/src/commands/doctor.dart:29:39)
#11     _AsyncAwaitCompleter.start (dart:async/runtime/libasync_patch.dart:49:6)
#12     DoctorCommand.runCommand (package:flutter_tools/src/commands/doctor.dart:28:42)
#13     FlutterCommand.verifyThenRunCommand (package:flutter_tools/src/runner/flutter_command.dart:372:18)
#14     _asyncThenWrapperHelper.<anonymous closure> (dart:async/runtime/libasync_patch.dart:77:64)
#15     _rootRunUnary (dart:async/zone.dart:1132:38)
#16     _CustomZone.runUnary (dart:async/zone.dart:1029:19)
#17     _FutureListener.handleValue (dart:async/future_impl.dart:129:18)
#18     Future._propagateToListeners.handleValueCallback (dart:async/future_impl.dart:642:45)
#19     Future._propagateToListeners (dart:async/future_impl.dart:671:32)
#20     Future._complete (dart:async/future_impl.dart:476:7)
#21     _SyncCompleter.complete (dart:async/future_impl.dart:51:12)
#22     _AsyncAwaitCompleter.complete.<anonymous closure> (dart:async/runtime/libasync_patch.dart:33:20)
#23     _rootRun (dart:async/zone.dart:1124:13)
#24     _CustomZone.run (dart:async/zone.dart:1021:19)
#25     _CustomZone.bindCallback.<anonymous closure> (dart:async/zone.dart:947:23)
#26     _microtaskLoop (dart:async/schedule_microtask.dart:41:21)
#27     _startMicrotaskLoop (dart:async/schedule_microtask.dart:50:5)
#28     _runPendingImmediateCallback (dart:isolate/runtime/libisolate_patch.dart:115:13)
#29     _RawReceivePortImpl._handleMessage (dart:isolate/runtime/libisolate_patch.dart:172:5)

And no solution, I don't know why this happen.

anybody help me.

@zoechi zoechi added c: crash Stack traces logged to the console tool Affects the "flutter" command-line tool. See also t: labels. platform-mac Building on or for macOS specifically t: flutter doctor Problem related to the "flutter doctor" tool labels Oct 24, 2018
@zoechi zoechi added this to the Goals milestone Oct 24, 2018
@jordansilva
Copy link

jordansilva commented Oct 24, 2018

I'm facing the same issue. I tried everything. Changed the channel, reinstall ideviceinstaller and libimobiledevice using --HEAD. I removed files from /var/db/lockdown/* and gave permission 777 to /var/db/lockdown/.

$ flutter doctor
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel dev, v0.10.1, on Mac OS X 10.13.6 17G65, locale en-NL)
⣽Unhandled exception:
Exception: idevice_id returned an error:

#0      IMobileDevice.getInfoForDevice (package:flutter_tools/src/ios/mac.dart:122:9)`

@Hanggi
Copy link
Author

Hanggi commented Oct 24, 2018

@jordansilva yes, me too, somebody said plug in the iphone to the computer, but still not work for me.

I remember that there was a problem like follow.

A recent change to libimobiledevice bumped the constraint on libusbmuxd to >= version 1.1.0. The current usbmuxd homebrew package is version 1.0.10.

After I fix this issue, the flutter doctor return Exception: idevice_id returned an error:

@jordansilva
Copy link

@Hanggi I plugged my phone and seems to work now :)

brew uninstall ideviceinstaller -g
brew uninstall libimobiledevice -g
brew install --HEAD libimobiledevice -g
brew install ideviceinstaller -g
sudo rm -rf /var/db/lockdown/*
sudo chmod -R 777 /var/db/lockdown/

@xhidnoda
Copy link

xhidnoda commented Oct 30, 2018

Nop...still not work for me. Same result.

@jpeiffer
Copy link

Same. Every time I attempt to launch the Flutter app, I receive:

idevice_id returned an error:
Exited (1)

flutter doctor -v results in:

[jpeiffer] ~/git/urbanft/flutter-uft$ flutter doctor -v
[✓] Flutter (Channel beta, v0.9.4, on Mac OS X 10.14 18A391, locale en-US)
    • Flutter version 0.9.4 at /Users/jpeiffer/flutter
    • Framework revision f37c235c32 (5 weeks ago), 2018-09-25 17:45:40 -0400
    • Engine revision 74625aed32
    • Dart version 2.1.0-dev.5.0.flutter-a2eb050044

⣾Unhandled exception:
Exception: idevice_id returned an error:

#0      IMobileDevice.getInfoForDevice (package:flutter_tools/src/ios/mac.dart:122:9)
<asynchronous suspension>
#1      IOSDevice.getAttachedDevices (package:flutter_tools/src/ios/devices.dart:152:53)
<asynchronous suspension>
#2      IOSDevices.pollingGetDevices (package:flutter_tools/src/ios/devices.dart:112:57)
#3      PollingDeviceDiscovery.devices (package:flutter_tools/src/device.dart:163:52)
<asynchronous suspension>
#4      DeviceManager.getAllConnectedDevices (package:flutter_tools/src/device.dart:91:46)
<asynchronous suspension>
#5      DeviceValidator.validate (package:flutter_tools/src/doctor.dart:607:54)
<asynchronous suspension>
#6      Doctor.startValidatorTasks (package:flutter_tools/src/doctor.dart:105:52)
#7      Doctor.diagnose (package:flutter_tools/src/doctor.dart:162:41)
#8      _AsyncAwaitCompleter.start (dart:async/runtime/libasync_patch.dart:49:6)
#9      Doctor.diagnose (package:flutter_tools/src/doctor.dart:152:24)
#10     DoctorCommand.runCommand (package:flutter_tools/src/commands/doctor.dart:29:39)
#11     _AsyncAwaitCompleter.start (dart:async/runtime/libasync_patch.dart:49:6)
#12     DoctorCommand.runCommand (package:flutter_tools/src/commands/doctor.dart:28:42)
#13     FlutterCommand.verifyThenRunCommand (package:flutter_tools/src/runner/flutter_command.dart:372:18)
#14     _asyncThenWrapperHelper.<anonymous closure> (dart:async/runtime/libasync_patch.dart:77:64)
#15     _rootRunUnary (dart:async/zone.dart:1132:38)
#16     _CustomZone.runUnary (dart:async/zone.dart:1029:19)
#17     _FutureListener.handleValue (dart:async/future_impl.dart:129:18)
#18     Future._propagateToListeners.handleValueCallback (dart:async/future_impl.dart:642:45)
#19     Future._propagateToListeners (dart:async/future_impl.dart:671:32)
#20     Future._complete (dart:async/future_impl.dart:476:7)
#21     _SyncCompleter.complete (dart:async/future_impl.dart:51:12)
#22     _AsyncAwaitCompleter.complete.<anonymous closure> (dart:async/runtime/libasync_patch.dart:33:20)
#23     _rootRun (dart:async/zone.dart:1124:13)
#24     _CustomZone.run (dart:async/zone.dart:1021:19)
#25     _CustomZone.bindCallback.<anonymous closure> (dart:async/zone.dart:947:23)
#26     _microtaskLoop (dart:async/schedule_microtask.dart:41:21)
#27     _startMicrotaskLoop (dart:async/schedule_microtask.dart:50:5)
#28     _runPendingImmediateCallback (dart:isolate/runtime/libisolate_patch.dart:115:13)
#29     _RawReceivePortImpl._handleMessage (dart:isolate/runtime/libisolate_patch.dart:172:5)

@zoechi
Copy link
Contributor

zoechi commented Oct 31, 2018

Merging with #23341 because there is more discussion

@zoechi zoechi closed this as completed Oct 31, 2018
@sunxxg
Copy link

sunxxg commented Nov 5, 2018

nice

@gwenqing
Copy link

How to solve this problem

@zoechi
Copy link
Contributor

zoechi commented Dec 17, 2018

@gwenqing follow #23341

@frazras
Copy link

frazras commented Jan 2, 2019

running sudo pkill usbmuxd worked for me on Mac OSX

@nisimjoseph
Copy link

nisimjoseph commented Feb 23, 2019

I notice something interesting on my end, the Apple Simulator and Android working well and detected well. but when I connect real iPhone device, iPhone 6/7, both cause the issue.
When I remove them from the computer USB all back to work and the simulators, Android and iOS working great.

Does anyone know why the real devices causing it?

Plus, when I do brew install --HEAD libimobiledevice it gives me an exception on the build.

@polotto
Copy link

polotto commented Mar 22, 2019

I got this error too. I tried all the solutions above and I couldn't solve this in my Mac.

[✓] Flutter (Channel stable, v1.2.1, on Mac OS X 10.14.3 18D109, locale pt-BR)
    • Flutter version 1.2.1 at /Users/polotto/flutter
    • Framework revision 8661d8aecd (5 weeks ago), 2019-02-14 19:19:53 -0800
    • Engine revision 3757390fa4
    • Dart version 2.1.2 (build 2.1.2-dev.0.0 0a7dcf17eb)

⣻Unhandled exception:
Exception: ideviceinfo returned an error:

#0      IMobileDevice.getInfoForDevice (package:flutter_tools/src/ios/mac.dart:141:9)
<asynchronous suspension>
#1      IOSDevice.getAttachedDevices (package:flutter_tools/src/ios/devices.dart:156:55)
<asynchronous suspension>
#2      IOSDevices.pollingGetDevices (package:flutter_tools/src/ios/devices.dart:110:57)
#3      PollingDeviceDiscovery.devices (package:flutter_tools/src/device.dart:171:52)
<asynchronous suspension>
#4      DeviceManager.getAllConnectedDevices (package:flutter_tools/src/device.dart:99:46)
<asynchronous suspension>
#5      DeviceValidator.validate (package:flutter_tools/src/doctor.dart:694:54)
<asynchronous suspension>
#6      Doctor.startValidatorTasks (package:flutter_tools/src/doctor.dart:116:52)
#7      Doctor.diagnose (package:flutter_tools/src/doctor.dart:189:41)
#8      _AsyncAwaitCompleter.start (dart:async/runtime/libasync_patch.dart:49:6)
#9      Doctor.diagnose (package:flutter_tools/src/doctor.dart:179:24)
#10     DoctorCommand.runCommand (package:flutter_tools/src/commands/doctor.dart:48:39)
#11     _AsyncAwaitCompleter.start (dart:async/runtime/libasync_patch.dart:49:6)
#12     DoctorCommand.runCommand (package:flutter_tools/src/commands/doctor.dart:34:42)
#13     FlutterCommand.verifyThenRunCommand (package:flutter_tools/src/runner/flutter_command.dart:545:18)
#14     _asyncThenWrapperHelper.<anonymous closure> (dart:async/runtime/libasync_patch.dart:77:64)
#15     _rootRunUnary (dart:async/zone.dart:1132:38)
#16     _CustomZone.runUnary (dart:async/zone.dart:1029:19)
#17     _FutureListener.handleValue (dart:async/future_impl.dart:126:18)
#18     Future._propagateToListeners.handleValueCallback (dart:async/future_impl.dart:639:45)
#19     Future._propagateToListeners (dart:async/future_impl.dart:668:32)
#20     Future._complete (dart:async/future_impl.dart:473:7)
#21     _SyncCompleter.complete (dart:async/future_impl.dart:51:12)
#22     _AsyncAwaitCompleter.complete.<anonymous closure> (dart:async/runtime/libasync_patch.dart:33:20)
#23     _rootRun (dart:async/zone.dart:1124:13)
#24     _CustomZone.run (dart:async/zone.dart:1021:19)
#25     _CustomZone.bindCallback.<anonymous closure> (dart:async/zone.dart:947:23)
#26     _microtaskLoop (dart:async/schedule_microtask.dart:41:21)
#27     _startMicrotaskLoop (dart:async/schedule_microtask.dart:50:5)
#28     _runPendingImmediateCallback (dart:isolate/runtime/libisolate_patch.dart:115:13)
#29     _RawReceivePortImpl._handleMessage (dart:isolate/runtime/libisolate_patch.dart:172:5)

@nisimjoseph
Copy link

Hi @angelopolotto,
I got this error too when the libimobiledevice is not installed well.
did you got errors when doing brew install --HEAD libimobiledevice ?
if so, please do the following steps I wrote here #10633 (comment) and it supposed to work for you.

@polotto
Copy link

polotto commented Mar 25, 2019

I was getting this error, the odd is that error isn't clear:

Updating Homebrew...
Error: libimobiledevice 1.2.0_3 is already installed
To install HEAD_3, first run `brew unlink libimobiledevice`
Warning: Skipping (old) /usr/local/Cellar/libimobiledevice/1.2.0_3 due to it being linked

But, I solved with your comment instructions, thank you so much!

@magnatestech
Copy link

@frazras thanks
running sudo pkill usbmuxd worked for me on Mac OSX

@humbertojllins
Copy link

humbertojllins commented Apr 9, 2019

@Hanggi I plugged my phone and seems to work now :)

brew uninstall ideviceinstaller -g
brew uninstall libimobiledevice -g
brew install --HEAD libimobiledevice -g
brew install ideviceinstaller -g
sudo rm -rf /var/db/lockdown/*
sudo chmod -R 777 /var/db/lockdown/

tks man!

@bobdeng
Copy link

bobdeng commented Apr 10, 2019

I notice something interesting on my end, the Apple Simulator and Android working well and detected well. but when I connect real iPhone device, iPhone 6/7, both cause the issue.
When I remove them from the computer USB all back to work and the simulators, Android and iOS working great.

Does anyone know why the real devices causing it?

Plus, when I do brew install --HEAD libimobiledevice it gives me an exception on the build.

me too

@bobdeng
Copy link

bobdeng commented Apr 10, 2019

I notice something interesting on my end, the Apple Simulator and Android working well and detected well. but when I connect real iPhone device, iPhone 6/7, both cause the issue.
When I remove them from the computer USB all back to work and the simulators, Android and iOS working great.

Does anyone know why the real devices causing it?

Plus, when I do brew install --HEAD libimobiledevice it gives me an exception on the build.

I got exception when I use iPhone 6, it's ok when I use iPad 4

@nisimjoseph
Copy link

@bobdeng please see here #10633 (comment). I had the same issue with the USB, this will take care it if the compilation pass fine.
the issue is in the resolved ticket.

@JLPenaLopez
Copy link

@Hanggi I plugged my phone and seems to work now :)

brew uninstall ideviceinstaller -g
brew uninstall libimobiledevice -g
brew install --HEAD libimobiledevice -g
brew install ideviceinstaller -g
sudo rm -rf /var/db/lockdown/*
sudo chmod -R 777 /var/db/lockdown/

Thanks! 👍

@carlose18
Copy link

@Hanggi I plugged my phone and seems to work now :)

brew uninstall ideviceinstaller -g
brew uninstall libimobiledevice -g
brew install --HEAD libimobiledevice -g
brew install ideviceinstaller -g
sudo rm -rf /var/db/lockdown/*
sudo chmod -R 777 /var/db/lockdown/

craaaackkkk

@chankongching
Copy link

chankongching commented Jun 24, 2019

in the latest version of brew, after running brew update, those old commands are not working. According to documentation of here, this is the command to make it work, and the following had fixed my problem

brew update
brew uninstall --ignore-dependencies libimobiledevice
brew uninstall --ignore-dependencies usbmuxd
brew install --HEAD usbmuxd
brew unlink usbmuxd
brew link usbmuxd
brew install --HEAD libimobiledevice

@lawreyios
Copy link

running sudo pkill usbmuxd worked for me on Mac OSX

Did this and a restart of my VisualStudioCode and business back to normal!

@github-actions
Copy link

This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 14, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
c: crash Stack traces logged to the console platform-mac Building on or for macOS specifically t: flutter doctor Problem related to the "flutter doctor" tool tool Affects the "flutter" command-line tool. See also t: labels.
Projects
None yet
Development

No branches or pull requests