Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

iOS Observatory not discovered after 30 seconds. Error launching application on iPhone

Tags:

ios

flutter

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?

like image 430
Marr Avatar asked Sep 11 '21 06:09

Marr


People also ask

Why does my iOS app take so long to launch?

The flood of reports of this issue usually coincides with the iOS updates. Long app launch times is a commonly reported problem when there's a pending iOS update on your test device, or when your test device is running a newer OS than the one shipped with Xcode.

How to fix app not opening on iPhone?

How to Fix App Not Opening on iPhone 1. Turn Off iPhone and Back On:. The very basic thing you can do is trying shut down your iPhone and booting it, I had... 2. Check App Updates:. Sometimes there might be issue with the current version of app and most of times developers fix... 3. Force Quit App:. ...

Is it possible to reproduce Observatory timeout while debugging?

The issue isn't a crash, it's an observatory timeout while debugging. There is no code to reproduce an observatory timeout. You are using a different OS, mobile device and probably not my same computer specs. The flood of reports of this issue usually coincides with the iOS updates.

How to fix app crashing on iPhone?

Deleting and re-installing the app can fix app crash on iPhone most of the time, you can simply do that by: Go to your "Home Screen". Find the app you want to delete, press and hold it for some seconds. App icon will start to wobble, press the "X" mark on top of the icon and delete the app. Now you can head to "'App Store".


Video Answer


5 Answers

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.

like image 52
Deeps Avatar answered Oct 18 '22 17:10

Deeps


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

like image 21
Mijawel Avatar answered Oct 18 '22 16:10

Mijawel


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
like image 20
Khamidjon Khamidov Avatar answered Oct 18 '22 17:10

Khamidjon Khamidov


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!
like image 28
Ben Villamayor Avatar answered Oct 18 '22 16:10

Ben Villamayor


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
like image 38
Alexa289 Avatar answered Oct 18 '22 16:10

Alexa289