Error launching application on iPhone Flutter

Viewed 1204

I'm unable to test my flutter application on VSCode which is running on catalina on vitual box.

After launching application from VSCode, I am just getting single line error Error launching application on Najam’s iPhone. and then application is opening in the device but it is then disconnected with VSCode

Launching lib/main.dart on Najam’s iPhone in debug mode...
Automatically signing iOS for device deployment using specified development team in Xcode project: H5PHS46J86
Running pod install...                 277.5s
Running Xcode build...                                                  
 └─Compiling, linking and signing...   114.5s
Xcode build done.                      346.8s
Installing and launching...            59.8s
Error launching application on Najam’s iPhone.

What I've tried

As suggested here https://github.com/flutter/flutter/issues/69632#issuecomment-803646337, I tried below solution but it didn't work for me

  • Setting platform to 10.0 inside the Podfile (platform :ios, '10.0' )
  • Doing a combination of flutter clean, pod cache clean --all and pod install

I also tried this solution too https://stackoverflow.com/a/64661277/7290043. But it didn't work either.

  • flutter clean pod cache clean --all

  • rm -rf ios/Flutter/Flutter.framework

  • flutter pub get

  • pod install

  • flutter run

What should I do?

enter image description here

2 Answers

The time to launch is very long. What type of machine are you building on? VSCode debugging might just be timing out. Try running directly from xcode and a) see if it remains connected, and b) see if any further errors are reported

Same issue, I fixed it:

  1. flutter/bin/cache,delete flutter_tools.snapshot and flutter_tools.stamp;
  2. flutter/packages/flutter_tools/lib/src/ios/devices.dart, find 'await observatoryDiscovery.uri.timeout(const Duration(seconds: 60))'
  3. Then change 60 to 240
  4. flutter run
  5. wow, success
Related