38

I'm unable to debug a freshly created app on physical iOS devices when pubspec dependencies reach a certain size, because it causes the "waiting for observatory port" step to timeout after 30 seconds.

Devices tested: iPhone 12, iPhone 12 Pro

iOS versions tested: 14.7.1, 14.5

The app runs properly on emulator but not on ios real device. How do I fix this issue?

Marr
  • 555
  • 1
  • 6
  • 11

9 Answers9

75

This Error message occur when your iPhone is busy processing something. For example as below.

If you run Flutter doctor you will see message as below.

Error: iPhone X is busy: Fetching debug symbols for iPhone X. Xcode will continue when iPhone X is finished. (code -10)

To confirm I opened xCode -> windows -> Devices and Simulator and it was showing the progress. Let the progress complete and then confirm by running Flutter doctor to make sure there is no error message.

Deeps
  • 4,399
  • 1
  • 26
  • 27
  • 1
    It happened after I was clear about the Xcode cache. This answer is work for me. – iDevOrz Dec 23 '21 at 03:18
  • 1
    Good answer. What I had to do though was unpair the device from 'xCode -> windows -> Devices and Simulator` then repair it and it worked – テッド Mar 11 '22 at 10:28
36

Had the same problem after updating Xcode and running for the first time. As mentioned on the this github issue (https://github.com/flutter/flutter/issues/72161#issuecomment-994653225) I simply:

  • Opened ios/Runner.xcworkspace with the iPhone connected
  • Waited until "Fetching debug symbols" process finished
  • Closed Xcode
  • Run again from IDE and it worked!
Ben Villamayor
  • 391
  • 3
  • 4
13

I have encountered the same issue and following this process has fixed the problem for me on 14.7.1 and 14.8:

Uninstall the app

Restart the phone

Open the app using Xcode

Run 'flutter clean' for the project

Now it should work if you run it again.

If it still doesn't work you could try increasing the observatory timeout (the default appears to be 30 seconds):

localUri = await observatoryDiscovery.uri.timeout(const Duration(seconds: 30));

I'm not 100% sure why this problem appears inconsistently, but there is a lot of related discussion at the following link: https://github.com/flutter/flutter/issues/72161

אורי orihpt
  • 2,358
  • 2
  • 16
  • 41
Mijawel
  • 389
  • 2
  • 15
10

For coders who are as lazy as me, you could take these steps:

  1. Open xcode for the project: enter image description here

  2. Run the project from xcode:

enter image description here

  1. while(prompt_below_finished == false) wait for some time || make a coffee;

enter image description here

  1. Runs successfully. As for me, next time I ran with android studio , it run smoothly
Khamidjon Khamidov
  • 6,783
  • 6
  • 31
  • 62
1

run your project through Xcode, not from Xcode or Android Studio. it will show different error message.

when I run the Flutter project using Xcode, the error message was

"The sandbox is not in sync with the Podfile.lock..."

to solve this, I run pod install on the ios folder. run these 2 commands below on your terminal

cd ios
pod install
Alexa289
  • 8,089
  • 10
  • 74
  • 178
0

I have tried all the solutions here and for me the simplest works: move you Android Studio in the trash, download it and reinstall. for me the problem was with Android Studio 2021.1.1 Patch but I got there with several updates. a clean install solved the problem.

bl4ckr0se
  • 606
  • 8
  • 15
0

In My iPad case, It showed a white screen after compiling in the installing step for 5-10 minutes & it worked at the end without doing anything

Abdelrahman Tareq
  • 1,874
  • 3
  • 17
  • 32
0

in case you are running your flutter app on iOS by Wireless debug, you may have to wait 10 minutes until it's ready.

Amer Alzibak
  • 1,489
  • 15
  • 16
-4

Try updating your Xcode and MacOS to the latest versions.

Micheal C Wallas
  • 495
  • 6
  • 14