Skip to content

hot-reload on ios device not working #7233

Closed

Description

@mikemimik

Steps to Reproduce

  • start new project
  • try and flutter run -d DEVICE_ID

Logs

OrionsBelt:nothing orion$ flutter run -d OrionsPhone
Launching lib/main.dart on OrionsPhone...
Exception from flutter run: Exception: Timeout while attempting to retrieve Uri for Observatory
package:flutter_tools/src/base/common.dart 31         throwToolExit
package:flutter_tools/src/protocol_discovery.dart 55  ProtocolDiscovery.nextUri.<async>.<fn>
===== asynchronous gap ===========================
dart:async                                            _Future.timeout
package:flutter_tools/src/protocol_discovery.dart 53  ProtocolDiscovery.nextUri.<async>
===== asynchronous gap ===========================
dart:async                                            Future.Future.microtask
package:flutter_tools/src/protocol_discovery.dart     ProtocolDiscovery.nextUri
package:flutter_tools/src/ios/devices.dart 268        IOSDevice.startApp.<async>
dart:async                                            _SyncCompleter.complete
package:flutter_tools/src/ios/mac.dart 178            buildXcodeProject.<async>
dart:async                                            _SyncCompleter.complete
package:flutter_tools/src/base/process.dart 148       runAsync.<async>
===== asynchronous gap ===========================
dart:async                                            _asyncThenWrapperHelper
package:flutter_tools/src/ios/devices.dart            IOSDevice.startApp
package:flutter_tools/src/hot.dart 202                HotRunner._run.<async>
dart:async                                            _SyncCompleter.complete
package:flutter_tools/src/resident_runner.dart 124    ResidentRunner.startEchoingDeviceLog.<async>
===== asynchronous gap ===========================
dart:async                                            _asyncThenWrapperHelper
package:flutter_tools/src/hot.dart                    HotRunner._run
package:flutter_tools/src/hot.dart 130                HotRunner.run.<fn>
package:stack_trace                                   Chain.capture
package:flutter_tools/src/hot.dart 129                HotRunner.run
package:flutter_tools/src/commands/run.dart 240       RunCommand.runCommand.<async>

flutter run -d DEVICE_ID --verbose yields the following:

[ +331 ms] [100%] Installed package build/ios/Release-iphoneos/Runner.app
[ +186 ms] ------ Debug phase ------
[        ] Cannot debug (15fd8b8e59199c9d0f5ec890ed2a5e80104568e1ss) over WIFI.
[   +4 ms] Application launched on the device. Attempting to forward ports.

Flutter Doctor

OrionsBelt:nothing orion$ flutter doctor
[✓] Flutter (on Mac OS, channel master)
    • Flutter at /Users/orion/dev-build/flutter
    • Framework revision 37d78753a2 (27 hours ago),
    • Engine revision 2f32e8054d
    • Tools Dart version 1.21.0

[✓] Android toolchain - develop for Android devices (Android SDK 22.0.1)
    • Android SDK at /Users/orion/Library/Android/sdk
    • Platform android-22, build-tools 22.0.1
    • Java(TM) SE Runtime Environment (build 1.8.0_91-b14)

[✓] iOS toolchain - develop for iOS devices (Xcode 8.1)
    • XCode at /Applications/Xcode.app/Contents/Developer
    • Xcode 8.1, Build version 8B62

[✓] IntelliJ IDEA Community Edition (version 2016.3)
    • Dart plugin version 163.8651
    • Flutter plugin version 0.1.5

[✓] Connected devices
    • OrionsPhone • DEVICE_ID • ios • iOS 10.1.1 (14B100)

Activity

  1. mikemimik commented on Dec 10, 2016

    @mikemimik
    ContributorAuthor

    It would seem like the package libimobiledevice defaults to finding a device on the same wifi over usb port. It would seem like at some point it would be worthwhile to put some time into learning precisely what libimobiledevice is doing, and how it's functioning.

    Solution: turning off wifi on my device, allowed the lib to connect to my device over usb and everything worked fine.

  2. mikemimik commented on Dec 10, 2016

    @mikemimik
    ContributorAuthor

    Potentially unrelated:

    Syncing files to device...
    Error writing "build/flx/fonts/RobotoCondensed-Bold.ttf" to DevFS: OS Error: Invalid argument, errno = 22
    dart:async/future.dart 197                                 Future.Future.error
    dart:io/http_impl.dart 1941                                _HttpClient._getConnection.connect
    package:stack_trace/src/stack_zone_specification.dart 107  StackZoneSpecification._registerUnaryCallback.<fn>.<fn>
    package:stack_trace/src/stack_zone_specification.dart 185  StackZoneSpecification._run
    package:stack_trace/src/stack_zone_specification.dart 107  StackZoneSpecification._registerUnaryCallback.<fn>
    package:stack_trace/src/stack_zone_specification.dart 107  StackZoneSpecification._registerUnaryCallback.<fn>.<fn>
    package:stack_trace/src/stack_zone_specification.dart 185  StackZoneSpecification._run
    package:stack_trace/src/stack_zone_specification.dart 107  StackZoneSpecification._registerUnaryCallback.<fn>
    dart:async/zone.dart 1158                                  _rootRunUnary
    dart:async/zone.dart 1037                                  _CustomZone.runUnary
    dart:async/future_impl.dart 150                            _FutureListener.handleError
    dart:async/future_impl.dart 649                            _Future._propagateToListeners.handleError
    dart:async/future_impl.dart 671                            _Future._propagateToListeners
    dart:async/future_impl.dart 477                            _Future._completeWithValue
    dart:async/future_impl.dart 528                            _Future._asyncComplete.<fn>
    package:stack_trace/src/stack_zone_specification.dart 185  StackZoneSpecification._run
    package:stack_trace/src/stack_zone_specification.dart 97   StackZoneSpecification._registerCallback.<fn>
    package:stack_trace/src/stack_zone_specification.dart 185  StackZoneSpecification._run
    package:stack_trace/src/stack_zone_specification.dart 97   StackZoneSpecification._registerCallback.<fn>
    dart:async/zone.dart 1150                                  _rootRun
    dart:async/zone.dart 1026                                  _CustomZone.run
    dart:async/zone.dart 924                                   _CustomZone.runGuarded
    dart:async/zone.dart 951                                   _CustomZone.bindCallback.<fn>
    dart:async/schedule_microtask.dart 41                      _microtaskLoop
    dart:async/schedule_microtask.dart 50                      _startMicrotaskLoop
    dart:isolate-patch/isolate_patch.dart 96                   _runPendingImmediateCallback
    dart:isolate-patch/isolate_patch.dart 149                  _RawReceivePortImpl._handleMessage
    ...
    
  3. added
    toolAffects the "flutter" command-line tool. See also t: labels.
    on Dec 12, 2016
  4. eseidelGoogle commented on Dec 12, 2016

    @eseidelGoogle
    Contributor

    There may be something we can do to detect this kind of device connection via libimobiledevice and either support it or explicitly say we don't. @danrubel

  5. xster commented on Feb 8, 2017

    @xster
    Member

    We may have already fixed it with #6111
    1- New computer
    2- Followed https://flutter.io/setup/ mostly
    3- flutter create an app
    4- flutter run on physical device

    $ flutter run
    Launching lib/main.dart on  in debug mode...
    Exception from flutter run: Exception: Timeout while attempting to retrieve Uri for Observatory
    package:flutter_tools/src/base/common.dart 30         throwToolExit
    package:flutter_tools/src/protocol_discovery.dart 55  ProtocolDiscovery.nextUri.<async>.<fn>
    ===== asynchronous gap ===========================
    dart:async                                            _Future.timeout
    package:flutter_tools/src/protocol_discovery.dart 53  ProtocolDiscovery.nextUri.<async>
    ===== asynchronous gap ===========================
    dart:async                                            Future.Future.microtask
    package:flutter_tools/src/protocol_discovery.dart     ProtocolDiscovery.nextUri
    package:flutter_tools/src/ios/devices.dart 271        IOSDevice.startApp.<async>
    dart:async                                            _SyncCompleter.complete
    package:flutter_tools/src/ios/mac.dart 190            buildXcodeProject.<async>
    dart:async                                            _SyncCompleter.complete
    package:flutter_tools/src/base/process.dart 145       runAsync.<async>
    ===== asynchronous gap ===========================
    dart:async                                            _asyncThenWrapperHelper
    package:flutter_tools/src/ios/devices.dart            IOSDevice.startApp
    package:flutter_tools/src/run_hot.dart 161            HotRunner._run.<async>
    dart:async                                            _SyncCompleter.complete
    package:flutter_tools/src/resident_runner.dart 185    ResidentRunner.startEchoingDeviceLog.<async>
    ===== asynchronous gap ===========================
    dart:async                                            _asyncThenWrapperHelper
    package:flutter_tools/src/run_hot.dart                HotRunner._run
    package:flutter_tools/src/run_hot.dart 78             HotRunner.run.<fn>
    package:stack_trace                                   Chain.capture
    package:flutter_tools/src/run_hot.dart 77             HotRunner.run
    package:flutter_tools/src/commands/run.dart 278       RunCommand.runCommand.<async>
    

    No hot reload.

    $ flutter doctor
    
    [✓] Flutter (on Mac OS, channel master)
        • Flutter at /Users/xster/development/flutter
        • Framework revision 428023ceeb (2 hours ago), 2017-02-08 10:56:03
        • Engine revision cbf49d0652
        • Tools Dart version 1.22.0-dev.10.6
    
    [✓] Android toolchain - develop for Android devices (Android SDK 25.0.2)
        • Android SDK at /Users/xster/Library/Android/sdk
        • Platform android-25, build-tools 25.0.2
        • Java(TM) SE Runtime Environment (build 1.8.0_112-b16)
    
    [-] iOS toolchain - develop for iOS devices (Xcode 8.2.1)
        • Xcode at /Applications/Xcode.app/Contents/Developer
        • Xcode 8.2.1, Build version 8C1002
        • ios-deploy 1.9.1
        x libimobiledevice is incompatible with the installed Xcode version. To update, run:
          brew uninstall libimobiledevice
          brew install --HEAD libimobiledevice                <=========== the solution
    
    [✓] IntelliJ IDEA Community Edition (version 2016.3.4)
        • Dart plugin version 163.13137
        • Flutter plugin version 0.1.9.1
    
    [✓] Connected devices
        •  • ff369dfd5f4a80545a431441c1e3066f8cb8d759 • ios • iOS  ()
    

    5- Do suggested fix
    6- flutter run again

    Everything works.

    Please reopen issue if it's still reproducible after flutter upgrade.

  6. rxlabz commented on Feb 21, 2017

    @rxlabz
    Contributor

    I don't know if it's reproductible elsewhere, but after upgrading flutter, I still can't run app on my iOS 10.2.1 device ( it works with simulator ) if WIFI is activated.

    Here my flutter doctor diagnostic :

    flutter doctor                                                            2 ↵
    [✓] Flutter (on Mac OS, channel master)
        • Flutter at /Users/rxlabz/dev/tools/flutter
        • Framework revision 1e1f7703cc (5 hours ago), 2017-02-21 12:22:26
        • Engine revision ab09530927
        • Tools Dart version 1.23.0-dev.0.0
    
    [✓] Android toolchain - develop for Android devices (Android SDK 25.0.2)
        • Android SDK at /Users/rxlabz/Library/Android/sdk
        • Platform android-25, build-tools 25.0.2
        • Java(TM) SE Runtime Environment (build 1.8.0_111-b14)
    
    [✓] iOS toolchain - develop for iOS devices (Xcode 8.2.1)
        • Xcode at /Applications/Xcode.app/Contents/Developer
        • Xcode 8.2.1, Build version 8C1002
        • ios-deploy 1.9.1
    
    [✓] Android Studio (version 2.2)
        • Android Studio at /Applications/Android Studio.app/Contents
        • Gradle version 2.14.1
    
    [✓] IntelliJ IDEA Ultimate Edition (version 2016.3.4)
        • Dart plugin version 163.13137
        • Flutter plugin version 0.1.10
    
    [✓] Connected devices
        • A3 A40    • 622004271815                             • android-arm • Android 6.0 (API 23)
        • RXMiniPad • f58ff425258a52e7af3a8509246f6e3f5b3c113a • ios         • iOS 10.2.1 (14D27)
        • iPad Air  • 2B4DFECA-26F5-43F6-96C7-771B3B32535B     • ios         • iOS 10.2 (simulator)
    

    When I flutter run -d RXMiniPad -v, the logs are ending by :

    [ +619 ms] ------ Debug phase ------
    [        ] Cannot debug f58ff425258a52e7af3a8509246f6e3f5b3c113a (UNKN, Unknown Device, uknownos, unkarch) over WIFI.
    [   +4 ms] Application launched on the device. Attempting to forward ports.
    

    The complete logs are here

  7. eseidelGoogle commented on Feb 21, 2017

    @eseidelGoogle
    Contributor

    Thanks @rxlabz, that's helpful. I'm sure @cbracken will be interested to see this. I worry this is going to get lost at the end of this closed-bug. Would you be willing to put that into a new bug instead and we can be sure to track/fix it for you? https://github.com/flutter/flutter/issues/new

  8. cbracken commented on Feb 21, 2017

    @cbracken
    Member

    #8308 now fixed.

  9. github-actions commented on Sep 5, 2021

    @github-actions

    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.

  10. locked as resolved and limited conversation to collaborators on Sep 5, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    platform-macosBuilding on or for macOS specificallyt: hot reloadReloading code during "flutter run"toolAffects the "flutter" command-line tool. See also t: labels.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions