How to fix installation of flutter application in iOS devices? - ios

I'm new in flutter and iOS also, I was developing my first project in flutter using Windows then done but now I want to develop an iOS app. So, I copied my project from Windows and paste into Mac. I installed all thing which is related to flutter. Now, When i am trying to install an app on simulator then
Xcode showing error :
The request was denied by service delegate (SBMainWorkspace) for reason: Unspecified.
I searched a lot on same error but i did not find the solution of this.I searched on github and stackoverflow also but their answer did not work.
Flutter doctor :
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, v1.7.8+hotfix.2, on Mac OS X 10.14.5 18F132, locale en-IN)
[✓] Android toolchain - develop for Android devices (Android SDK version 28.0.3)
[✓] Xcode - develop for iOS and macOS (Xcode 10.2.1)
[✓] iOS tools - develop for iOS devices
[✓] Android Studio (version 3.1)
[✓] Connected device (2 available)
• No issues found!
My App is installing but when it appears then suddenly crash and xcode showing error message box.How to fix it ?
If someone has query or any question then ask me please.Thank you.

Try this :
You may want to check your scheme. The executable should be asked on launch.
Edit Scheme -> Info -> Executable -> Ask on launch
reference apple forum answer: https://forums.developer.apple.com/message/258839

Related

Flutter crashes on launch of app after build. iOS only

When I try to launch the ioS emulator, it goes through the process and the icon appears on the screen, the splash screen loads and then crashes.
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 3.3.4, on macOS 12.5.1 21G83 darwin-x64, locale en-IE)
[✓] Android toolchain - develop for Android devices (Android SDK version 31.0.0)
[✓] Xcode - develop for iOS and macOS (Xcode 14.1)
[✓] Chrome - develop for the web
[✓] Android Studio (version 3.6)
[✓] IntelliJ IDEA Community Edition (version 2021.2.2)
[✓] VS Code (version 1.73.1)
[✓] Connected device (4 available)
[✓] HTTP Host Availability
• No issues found!
Flutter doctor comes back fine and I can run the Android emulator.
After hours of trouble shooting I can only think that there is some issue with my iOS folder.
I can go through the whole build process and then then app crashes on launch.
There is no error appearing in the terminal but I'm guessing there is a conflict somewhere.
Could it be the info.plist?
Has anyone got any ideas how I can troubleshot it.
Is there any where I can see a log file or an error?
I have tried emulator and physical device it won't launch past the splash on both
Thanks for any help
Flutter app doesn't show error logs when the app gets crashed in iPhones, it's common and irritating.
To solve it, by my experience, the protip is:
Open its ios folder in Xcode.
Select the device in which you want to run it.
Run it through Xcode, it will show the errors in Xcode's log panel which you can fix easily then.

Firebase not connecting to iOS app even though google info plist file attached

My flutter app is crashing when I connect it to firebase and try to use it. It is only happening for this app(other apps are connecting fine). I am not sure why? Any suggestions would be greatly appreciated.I followed several tutorials and all of them did the same.
I have registered the app :
Provided bundle identifier
Attached the info-plist file
Flutter doctor :
[✓] Flutter (Channel unknown, 2.0.0, on Mac OS X 10.15.7 19H524 darwin-x64, locale en-IN)
[✗] Android toolchain - develop for Android devices
✗ Unable to locate Android SDK.
Install Android Studio from: https://developer.android.com/studio/index.html
On first launch it will assist you in installing the Android SDK components.
(or visit https://flutter.dev/docs/get-started/install/macos#android-setup for detailed
instructions).
If the Android SDK has been installed to a custom location, please use
flutter config --android-sdk to update to that location.
[✓] Xcode - develop for iOS and macOS
[✓] Chrome - develop for the web
[!] Android Studio (not installed)
[✓] Connected device (2 available)
Flutter run :
Running Xcode build...
└─Compiling, linking and signing... 30.6s
Xcode build done. 76.0s
Lost connection to device.
Activating Dart DevTools... 4.0s
looks like you haven't installed flutter correctly.
check https://docs.flutter.dev/get-started/install/macos

Flutter's video_player throwing a PlatformException on iOS

I'm trying to run my Flutter application on iOS Simulator and I have found that video player throws the following exception on init:
[VERBOSE-2:ui_dart_state.cc(209)] Unhandled Exception: PlatformException(VideoError, Failed to load video: The operation could not be completed, null, null)
After some googling, I found that there could be several fixes for that:
Upgrading flutter
Downgrading vide_player to 2.2.3
Configuring web server to support Range header
I am running the latest flutter version, also downgrading plugin didn't do pretty much anything. I made sure that web server does support Range header by playing video in a browser.
I have also checked network requests in flutter DevTools and it seems that network request is never made (looking at other API requests working fine).
Another note is that this problem does not happen on Android emulator/real device and video plays just fine.
What could cause this issue? Is there any possible way to enable more verbose logging to see what exactly causes the issue, or is there something I missing? Thanks for the help.
Additional information:
Flutter 2.6.0-12.0.pre.899 on master branch
Xcode 13 from AppStore
iOS 15 running on Simulator
Doctor summary:
[✓] Flutter (Channel master, 2.6.0-12.0.pre.899, on macOS 12.0.1 21A559
darwin-arm, locale en-RU)
[✗] Android toolchain - develop for Android devices
✗ Unable to locate Android SDK.
Install Android Studio from:
https://developer.android.com/studio/index.html
On first launch it will assist you in installing the Android SDK
components.
(or visit https://flutter.dev/docs/get-started/install/macos#android-setup
for detailed instructions).
If the Android SDK has been installed to a custom location, please use
`flutter config --android-sdk` to update to that location.
[✓] Xcode - develop for iOS and macOS (Xcode 13.1)
[✓] Chrome - develop for the web
[!] Android Studio (not installed)
[✓] VS Code (version 1.62.3)
[✓] Connected device (2 available)

Flutter - iOS Simulator "not supported devices connected"

For some reason, iOS Simulator stopped working. I can open iOS Simulator, but Android Studio not recognizes it. I've already tried to run via terminal, but it says not supported devices connected.
When I run flutter doctor it returns:
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, v1.12.13+hotfix.8, on Mac OS X 10.12.6 16G2136, locale pt-US)
[✓] Android toolchain - develop for Android devices (Android SDK version 28.0.3)
[!] Xcode - develop for iOS and macOS (Xcode 9.2)
✗ Flutter requires a minimum Xcode version of 11.0.0.
Download the latest version or update via the Mac App Store.
[✓] Android Studio (version 3.4)
[✓] VS Code (version 1.43.2)
[!] Connected device
! No devices available
! Doctor found issues in 2 categories.
Since I'm on a Macbook 2011, I won't be able to upgrade Xcode. Is it possible to downgrade Flutter and Xcode to an older stable version? Would this solve the problem?
Thanks
If Android Studio does not recognize ios simulator even though you can separately open simulator on your Mac, you have to add command line tool on Xcode.
open Xcode then go to Xcode > preferences > select Locations tab. Then select Xcode version from the drop-down menu.
Open ios simulator again. Then Android Studio will recognize your device.

Flutter installed but failed to start-up on real IOS device

Flutter failed to start-up on real IOS device (not emulator), its working fine on the IOS emulator but when I connect my device its installed but fails to launch without printing any message on flutter application log.
Launching lib/main.dart on XXXX in debug mode...
Automatically signing iOS for device deployment using specified development team in Xcode project: XXXXX
Running Xcode build...
└─Compiling, linking and signing... 10.7s
Xcode build done. 20.1s
Installing and launching...
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel master, v1.15.4-pre.262, on Mac OS X 10.14.6 18G3020, locale en-GB)
[✓] Android toolchain - develop for Android devices (Android SDK version 29.0.2)
[✓] Xcode - develop for iOS and macOS (Xcode 11.3.1)
[✓] Android Studio (version 3.5)
[✓] IntelliJ IDEA Ultimate Edition (version 2019.3.1)
[✓] Connected device (1 available)
• No issues found!
could you please help!
There was an issue on Flutter repository as mentioned by #amer rawashdeh.
iOS 13.4 is now available, please update your iOS device and Xcode to v11.4 to keep your project newly working.
If you are on Flutter stable channel you need also to apply this guide to keep you project working with v11.4 Xcode
It seems the problem with ISO version 13.3.1 only
check it out:
https://github.com/flutter/flutter/issues/49504#issuecomment-581554697
The application was working on IOS emulator version 13.3

Resources