# Exception and Crashes on my iPhone

**URL:** <https://forum.social.plus/t/exception-and-crashes-on-my-iphone/893>\
**Category:** Flutter\
**Created:** [August 26, 2023, 7:42pm UTC](https://forum.social.plus/t/exception-and-crashes-on-my-iphone/893 "2023-08-26T19:42:04Z")\
**Posts on this page:** 17\
**Page:** 2

<div class="post-metadata">

**Author:** ![meridork](https://avatars.discourse-cdn.com/v4/letter/m/858c86/32.png) [@meridork](https://forum.social.plus/u/meridork)\
**Post date:** [September 11, 2023, 10:02pm UTC](https://forum.social.plus/t/exception-and-crashes-on-my-iphone/893/22 "2023-09-11T22:02:12Z")

</div>

I add the following command to remove exception 3

` String? token = await FirebaseMessaging.instance.getAPNSToken();`

---

<div class="post-metadata">

**Author:** ![meridork](https://avatars.discourse-cdn.com/v4/letter/m/858c86/32.png) [@meridork](https://forum.social.plus/u/meridork)\
**Post date:** [September 11, 2023, 10:10pm UTC](https://forum.social.plus/t/exception-and-crashes-on-my-iphone/893/23 "2023-09-11T22:10:15Z")

</div>

Update  
I have following exceptions without crash

**Exception 1**  
`SocketException: Bad file descriptor (OS Error: Bad file descriptor, errno = 9), address = ssq.eu.amity.co, port = 54665`

**Exception 2**  
`SocketException: Write failed (OS Error: Broken pipe, errno = 32), address = ssq.eu.amity.co, port = 54646`  
**Stack**  
#0 \_NativeSocket.write (dart:io-patch/socket\_patch.dart:1244)  
#1 \_RawSocket.write (dart:io-patch/socket\_patch.dart:2002)  
#2 \_ExternalBuffer.readToSocket (dart:io/secure\_socket.dart:1327)  
#3 \_RawSecureSocket.\_writeSocket (dart:io/secure\_socket.dart:1089)  
#4 \_RawSecureSocket.\_tryFilter (dart:io/secure\_socket.dart:1035)

**Exception 3**  
`SocketException: Operation timed out (OS Error: Operation timed out, errno = 60), address = ssq.eu.amity.co, port = 54494`

---

<div class="post-metadata">

**Author:** ![SocialPlus\_Support](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.social.plus/socialplus_support/32/798_2.png) [@SocialPlus\_Support](https://forum.social.plus/u/SocialPlus_Support)\
**Post date:** [September 12, 2023, 9:08am UTC](https://forum.social.plus/t/exception-and-crashes-on-my-iphone/893/24 "2023-09-12T09:08:43Z")

</div>

Hello, I assume these are the only exceptions you are currently encountering, and there have been no crashes, is that correct?

---

<div class="post-metadata">

**Author:** ![SocialPlus\_Support](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.social.plus/socialplus_support/32/798_2.png) [@SocialPlus\_Support](https://forum.social.plus/u/SocialPlus_Support)\
**Post date:** [September 12, 2023, 10:30am UTC](https://forum.social.plus/t/exception-and-crashes-on-my-iphone/893/25 "2023-09-12T10:30:49Z")

</div>

Hello, could you please include the complete error stack trace as well? Without it, it’s rather challenging for us to assist in identifying the issue. Thank you.

---

<div class="post-metadata">

**Author:** ![meridork](https://avatars.discourse-cdn.com/v4/letter/m/858c86/32.png) [@meridork](https://forum.social.plus/u/meridork)\
**Post date:** [September 12, 2023, 11:14am UTC](https://forum.social.plus/t/exception-and-crashes-on-my-iphone/893/26 "2023-09-12T11:14:40Z")

</div>

Update  
I hade more crashes  
Now on the same time App moved to background and after some seconds  
**exception**  
`SocketException: Write failed (OS Error: Broken pipe, errno = 32), address = ssq.eu.amity.co, port = 55757`  
**Stack**  
"#0 \_NativeSocket.write (dart:io-patch/socket\_patch.dart:1244)  
#1 \_RawSocket.write (dart:io-patch/socket\_patch.dart:2002)  
#2 \_ExternalBuffer.readToSocket (dart:io/secure\_socket.dart:1327)  
#3 \_RawSecureSocket.\_writeSocket (dart:io/secure\_socket.dart:1089)  
#4 \_RawSecureSocket.\_tryFilter (dart:io/secure\_socket.dart:1035) "   
**device**  
BaseDeviceInfo{data: {systemName: iOS, isPhysicalDevice: true, utsname: {release: 22.6.0, sysname: Darwin, nodename: Kobis-iPhone, machine: iPhone15,3, version: Darwin Kernel Version 22.6.0: Wed Jun 28 20:51:46 PDT 2023; root:xnu-8796.142.1~1/RELEASE\_ARM64\_T8120}, model: iPhone, localizedModel: iPhone, systemVersion: 16.6.1, name: iPhone, identifierForVendor: C00EFA5F-7161-48EB-B4A4-BE1F5C0A71D2}}

---

<div class="post-metadata">

**Author:** ![SocialPlus\_Support](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.social.plus/socialplus_support/32/798_2.png) [@SocialPlus\_Support](https://forum.social.plus/u/SocialPlus_Support)\
**Post date:** [September 12, 2023, 1:10pm UTC](https://forum.social.plus/t/exception-and-crashes-on-my-iphone/893/27 "2023-09-12T13:10:30Z")

</div>

So you have one new crash from when app moved to background?

Also, can we have full error stacktraces for the previous exceptions as well please?

---

<div class="post-metadata">

**Author:** ![meridork](https://avatars.discourse-cdn.com/v4/letter/m/858c86/32.png) [@meridork](https://forum.social.plus/u/meridork)\
**Post date:** [September 12, 2023, 1:15pm UTC](https://forum.social.plus/t/exception-and-crashes-on-my-iphone/893/28 "2023-09-12T13:15:07Z")

</div>

I have some crashes of the same type I sent you  
I time I write you an exception I added the stack, some exceptions don’t have stack information

---

<div class="post-metadata">

**Author:** ![meridork](https://avatars.discourse-cdn.com/v4/letter/m/858c86/32.png) [@meridork](https://forum.social.plus/u/meridork)\
**Post date:** [September 12, 2023, 9:01pm UTC](https://forum.social.plus/t/exception-and-crashes-on-my-iphone/893/29 "2023-09-12T21:01:18Z")

</div>

**Update**  
crash & exception at same time

**Exception**  
`SocketException: Write failed (OS Error: Broken pipe, errno = 32), address = ssq.eu.amity.co, port = 56747"`  
**Stack**  
`#0 _NativeSocket.write (dart:io-patch/socket_patch.dart:1244) #1 _RawSocket.write (dart:io-patch/socket_patch.dart:2002) #2 _ExternalBuffer.readToSocket (dart:io/secure_socket.dart:1327) #3 _RawSecureSocket._writeSocket (dart:io/secure_socket.dart:1089) #4 _RawSecureSocket._tryFilter (dart:io/secure_socket.dart:1035) <asynchronous suspension>`

---

<div class="post-metadata">

**Author:** ![meridork](https://avatars.discourse-cdn.com/v4/letter/m/858c86/32.png) [@meridork](https://forum.social.plus/u/meridork)\
**Post date:** [September 14, 2023, 1:33pm UTC](https://forum.social.plus/t/exception-and-crashes-on-my-iphone/893/30 "2023-09-14T13:33:41Z")

</div>

I created a new version without `background_fetch` and had the exception twice  
1 When killed the App  
2 When move the App to background

**Exception**  
`SocketException: Write failed (OS Error: Broken pipe, errno = 32), address = ssq.eu.amity.co, port = 60523`

**Stack**  
#0 \_NativeSocket.write (dart:io-patch/socket\_patch.dart:1244)  
#1 \_RawSocket.write (dart:io-patch/socket\_patch.dart:2002)  
#2 \_ExternalBuffer.readToSocket (dart:io/secure\_socket.dart:1327)  
#3 \_RawSecureSocket.\_writeSocket (dart:io/secure\_socket.dart:1089)  
#4 \_RawSecureSocket.\_tryFilter (dart:io/secure\_socket.dart:1035) "

**Device**  
BaseDeviceInfo{data: {systemName: iOS, isPhysicalDevice: true, utsname: {release: 22.6.0, sysname: Darwin, nodename: Kobis-iPhone, machine: iPhone15,3, version: Darwin Kernel Version 22.6.0: Wed Jun 28 20:51:46 PDT 2023; root:xnu-8796.142.1~1/RELEASE\_ARM64\_T8120}, model: iPhone, localizedModel: iPhone, systemVersion: 16.6.1, name: iPhone, identifierForVendor: C00EFA5F-7161-48EB-B4A4-BE1F5C0A71D2}}

---

<div class="post-metadata">

**Author:** ![SocialPlus\_Support](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.social.plus/socialplus_support/32/798_2.png) [@SocialPlus\_Support](https://forum.social.plus/u/SocialPlus_Support)\
**Post date:** [September 15, 2023, 9:47am UTC](https://forum.social.plus/t/exception-and-crashes-on-my-iphone/893/31 "2023-09-15T09:47:49Z")

</div>

**Update:** replied via email

---

<div class="post-metadata">

**Author:** ![meridork](https://avatars.discourse-cdn.com/v4/letter/m/858c86/32.png) [@meridork](https://forum.social.plus/u/meridork)\
**Post date:** [September 22, 2023, 8:16am UTC](https://forum.social.plus/t/exception-and-crashes-on-my-iphone/893/32 "2023-09-22T08:16:11Z")

</div>

Update  
I updated the new plugins, reduce firebase activities as possible.  
I still have crashes on iOS I think less than before.

I created some crashes after doing the following again some times and fast  
A. intensive scrolling the feed  
B. lock the screen  
C. open screen

**iOS**  
`SocketException: Bad file descriptor (OS Error: Bad file descriptor, errno = 9), address = ssq.eu.amity.co, port = 49593`

`SocketException: Can't assign requested address (OS Error: Can't assign requested address, errno = 49), address = ssq.eu.amity.co, port = 56324`

**Android**  
`SocketException: Software caused connection abort (OS Error: Software caused connection abort, errno = 103), address = ssq.eu.amity.co, port = 43300`

---

<div class="post-metadata">

**Author:** ![SocialPlus\_Support](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.social.plus/socialplus_support/32/798_2.png) [@SocialPlus\_Support](https://forum.social.plus/u/SocialPlus_Support)\
**Post date:** [September 22, 2023, 10:45am UTC](https://forum.social.plus/t/exception-and-crashes-on-my-iphone/893/33 "2023-09-22T10:45:32Z")

</div>

Hello @meridork as previously mentioned in the email where we offered our suggestions, if you could respond and provide the information we requested, we would be able to continue with our investigation. Thank you 🙏 🙂

---

<div class="post-metadata">

**Author:** ![meridork](https://avatars.discourse-cdn.com/v4/letter/m/858c86/32.png) [@meridork](https://forum.social.plus/u/meridork)\
**Post date:** [September 22, 2023, 1:13pm UTC](https://forum.social.plus/t/exception-and-crashes-on-my-iphone/893/34 "2023-09-22T13:13:02Z")

</div>

Thanks for your response  
Thanks for trying to create a crash with your code.

I updated the card with how I created a crash and thought it was important to you.

We will try to improve the App and remove the crashing.

Kobi

---

<div class="post-metadata">

**Author:** ![SocialPlus\_Support](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.social.plus/socialplus_support/32/798_2.png) [@SocialPlus\_Support](https://forum.social.plus/u/SocialPlus_Support)\
**Post date:** [September 22, 2023, 1:57pm UTC](https://forum.social.plus/t/exception-and-crashes-on-my-iphone/893/35 "2023-09-22T13:57:30Z")

</div>

@meridork Thank you for your understanding and cooperation. However, I’ve come across a topic that appears to be related to the issue you’ve been experiencing. It seems to be a problem associated with **Flutter** , as discussed here: [Frequent bad file descriptor errors on iOS #197](https://github.com/dart-lang/http/issues/197).

You may need to do further research to address the remaining errors, as they could potentially originate from Flutter itself. I hope this information is helpful!

Apart from this, if you have any questions or encounter any issues with our product, please don’t hesitate to get in touch 🙏

---

<div class="post-metadata">

**Author:** ![meridork](https://avatars.discourse-cdn.com/v4/letter/m/858c86/32.png) [@meridork](https://forum.social.plus/u/meridork)\
**Post date:** [September 22, 2023, 3:34pm UTC](https://forum.social.plus/t/exception-and-crashes-on-my-iphone/893/36 "2023-09-22T15:34:18Z")

</div>

Thanks  
Can you please describe the process that using following address that in the exception error?

`SocketException: Bad file descriptor (OS Error: Bad file descriptor, errno = 9), address = ssq.eu.amity.co, port = 50391`

---

<div class="post-metadata">

**Author:** ![SocialPlus\_Support](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.social.plus/socialplus_support/32/798_2.png) [@SocialPlus\_Support](https://forum.social.plus/u/SocialPlus_Support)\
**Post date:** [September 26, 2023, 10:53am UTC](https://forum.social.plus/t/exception-and-crashes-on-my-iphone/893/37 "2023-09-26T10:53:04Z")

</div>

It may not be related to the address. We still recommend conducting additional research around that topic. Until you have the debugging tool and can provide logs from the iOS side, we won’t be able to provide further assistance 🙏 🙂

---

<div class="post-metadata">

**Author:** ![meridork](https://avatars.discourse-cdn.com/v4/letter/m/858c86/32.png) [@meridork](https://forum.social.plus/u/meridork)\
**Post date:** [October 19, 2023, 10:30am UTC](https://forum.social.plus/t/exception-and-crashes-on-my-iphone/893/38 "2023-10-19T10:30:49Z")

</div>

Hello,  
I add the following to my code and from this time I don’t have creashes

1. Added to info.plist

```auto
||<key>FLTEnableImpeller</key>|
|---|---|
||<false/>|

```

1. add the function `didChangeAppLifecycleState` to stop listen on going to background and start on going to foreground

[Previous page](https://forum.social.plus/t/exception-and-crashes-on-my-iphone/893.md?page=1)
