ably / ably-flutter

A wrapper around our Cocoa and Java client library SDKs, providing iOS and Android support for those using Flutter and Dart.
https://ably.com/download
Apache License 2.0
60 stars 16 forks source link

Crash on IPhone 7 plus #527

Closed ashishp-dev closed 4 months ago

ashishp-dev commented 4 months ago

[NSTaggedPointerString stringValue]: unrecognized selector sent to instance 0xbeda7c7407f36903 Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[NSTaggedPointerString stringValue]: unrecognized selector sent to instance 0xbeda7c7407f36903' First throw call stack: (0x180927c60 0x198153ee4 0x1809f86e8 0x1808c154c 0x1808c075c 0x10634145c 0x1808d28c8 0x1809060f8 0x1063411fc 0x106340c6c 0x106318aa4 0x106317504 0x106316ec4 0x1063157ec 0x1805e8094 0x180595964 0x10631576c 0x1063149b0 0x1063140a8 0x10a9359ac 0x10a939638 0x111dd61e4 0x111845794 0x1805e7094 0x1805e8094 0x180594d44 0x180594994 0x1808e3014 0x1808a04f8 0x1808b3174 0x1a13ee988 0x1830b67d8 0x182e4fc70 0x10474901c 0x1060f04d0) libc++abi: terminating with uncaught exception of type NSException

┆Issue is synchronized with this Jira Task by Unito

VeskeR commented 4 months ago

Hi @ashishp-dev !

Could you please provide more context regarding the error? Specifically, what operation are you trying to perform (e.g. publish/receive a message), and which lines of code are causing the app to crash? Additionally, could you let me know what version of ably-flutter you are using?

Thank you!

ashishp-dev commented 4 months ago

Screenshot 2024-06-17 at 7 13 15 PM

I am using a ably_flutter: ^1.2.32 this flutter version

other IOS device is working fine i am facing this issue on Iphone 7 and iphone 12 only specific IOS related issue When i check logs i am getting like this

Screenshot 2024-06-17 at 7 20 15 PM

VeskeR commented 4 months ago

On which iOS version does this occur?

ashishp-dev commented 4 months ago

@VeskeR Any update??

ttypic commented 4 months ago

Hey @ashishp-dev,

We are still trying to reproduce the issue on our end. To help us understand the exact point at which the error occurs, could you please enable verbose logging and add the logs to the issue report? This would assist us in diagnosing the problem. Additionally, could you let us know if the issue only occurs on a physical device, or if it can be reproduced on an emulator as well?

ashishp-dev commented 4 months ago

Yes this is happening on the physical device of iPhone 7 plus. Not happening on the simulator. I am sharing more information

ashishp-dev commented 4 months ago

I am getting this logs

2024-06-18 15:26:56.644066+0530 Soul Train Dev[34906:1440758] DEBUG: (ARTAuth.m:171) RS:0x280ad03c0 setting up auth method Basic (anonymous) 2024-06-18 15:26:56.644474+0530 Soul Train Dev[34906:1440758] VERBOSE: (ARTRest.m:207) RS:0x280ad03c0 initialized 2024-06-18 15:26:56.644840+0530 Soul Train Dev[34906:1440758] VERBOSE: (ARTRealtime.m:248) R:0x2807d0600 initialized with RS:0x280ad03c0 2024-06-18 15:26:56.644940+0530 Soul Train Dev[34906:1440758] VERBOSE: (ARTRealtime.m:611) R:0x2807d0600 realtime state transitions to 1 - Connecting 2024-06-18 15:26:56.645032+0530 Soul Train Dev[34906:1440758] DEBUG: (ARTRealtime.m:622) RT:0x2807d0600 realtime is transitioning from 0 - Initialized to 1 - Connecting 2024-06-18 15:26:56.645345+0530 Soul Train Dev[34906:1440758] VERBOSE: (ARTWebSocketTransport.m:76) R:0x0 WS:0x281ff9aa0 alloc 2024-06-18 15:26:56.645499+0530 Soul Train Dev[34906:1440758] DEBUG: (ARTWebSocketTransport.m:122) R:0x2807d0600 WS:0x281ff9aa0 websocket connect with key 2024-06-18 15:26:56.645877+0530 Soul Train Dev[34906:1440758] -[NSTaggedPointerString stringValue]: unrecognized selector sent to instance 0x85874b536f59cda2 2024-06-18 15:26:56.646343+0530 Soul Train Dev[34906:1440758] Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[NSTaggedPointerString stringValue]: unrecognized selector sent to instance 0x85874b536f59cda2' First throw call stack: (0x180927c60 0x198153ee4 0x1809f86e8 0x1808c154c 0x1808c075c 0x10281545c 0x1808d28c8 0x1809060f8 0x1028151fc 0x102814c6c 0x1027ecaa4 0x1027eb504 0x1027eaec4 0x1027e97ec 0x1805e8094 0x180595964 0x1027e976c 0x1027e89b0 0x1027e80a8 0x106f759ac 0x106f79638 0x10e8621e4 0x10e2d1794 0x1805e7094 0x1805e8094 0x180594d44 0x180594994 0x1808e3014 0x1808a04f8 0x1808b3174 0x1a13ee988 0x1830b67d8 0x182e4fc70 0x100cc501c 0x1024c44d0) libc++abi: terminating with uncaught exception of type NSException

ashishp-dev commented 4 months ago

@VeskeR @ttypic Any update??

ttypic commented 4 months ago

Hey @ashishp-dev,

We still can't reproduce the issue. Could you please share the version of Flutter you are using? Please note that the latest version of Flutter officially supports only iOS 17. Could you also check our example app from this repository? Could you reproduce the issue with it?

ashishp-dev commented 4 months ago

@ttypic i am using this flutter version (3.22.1) Screenshot 2024-06-19 at 5 46 20 PM

ashishp-dev commented 4 months ago

@ttypic @VeskeR

Issue is resolved now when i write client options something like this.

final clientOptions = ably.ClientOptions(
    key: ApiConstant.ABLY_KEY,
    transportParams: {
      'remainPresentFor': remainPresentFor,
      'heartbeatInterval': heartbeatInterval
    },
    clientId: userID,
    logLevel: ably.LogLevel.verbose,
  );

  var realtime = ably.Realtime(key: ApiConstant.ABLY_KEY);
  realtime.options = clientOptions;

when i write like this my iphone 7 is crashing var realtime = ably.Realtime(key: ApiConstant.ABLY_KEY, options: clientOptions);

ttypic commented 4 months ago

Thank you for sharing this @ashishp-dev. Now I got it,

ably.Realtime(key: ApiConstant.ABLY_KEY, options: clientOptions);

You can't use it like this. You should specify either key or options, not both. If you specify both arguments, key will be ignored. Additionally, if you don't specify key or other authentication parameters inside your ClientOptions, it will fail.

Thank you once again for spotting this. We will throw an explicit exception in this case.

ashishp-dev commented 4 months ago

Still app is crashing, I identify the what is the main crash issue. When i write something like this that i am facing the crash

transportParams: {
      'remainPresentFor':'5000',
      'heartbeatInterval': '5000'
    },

without transportParams param my app is not crashing it is working fine. But my issue is we need this parameters as on our Backend system this is depending to go further. So i am not allowing to remove this transportParams . So can you please look into this at high priority. This crash issue is happen on some of the iPhone devices, like 7 plus with iOS running 15.x.x , second is iPhone 12 with iOS 16.5 running (almost latest OS) so we are struck for our release due to this. I urge you to check ASAP and give proper solution to come-out from this situation

ttypic commented 4 months ago

@ashishp-dev, we’ve found a potential problem related to the transportParams configuration and are working on it as a top priority. We'll keep you updated on our progress and aim to have a fix soon.

ttypic commented 4 months ago

@ashishp-dev We've published a new version (1.2.33) that should solve the issue. If the issue still exists, please feel free to reopen the ticket

ashishp-dev commented 4 months ago

Hey @ttypic

My crash problem is fixed now, this will help to lots of IOS crash If i will face any issues then i will contact to you

Thank you!