iOS Optimizely causing App to crash on send event
I was just wondering if anyone else using the beta iOS has had any issues with optimizely casuing the app to crash on a failed event send?
here is a snippet from our crash log. It seems to happen to one or two users once a day.
OptimizelySwizzler.m line 266
Optimization Co-ordinator at Widerfunnel
My crash reports tool also shows a considerable number of crashes for the same event.
Here it is:
@Denis thanks for your question! Are you able to provide the additional information:
- Full crash log
- SDK version you're using
- How this can be reproduced in your app?
We have found in certain cases that this type of crash may or may not be related something in Optimizely. I will follow up in a separate e-mail to further dive into the specific issue you're seeing in your app.
I recently added Optimizely to my app and experienced the same crash problem on the first day of operation. I have disabled the experiments straight away and I havent seen anymore crashes.
Specially I get the following exception:
Last Exception Backtrace:
|1||CoreFoundation||__exceptionPreprocess + 132|
|2||libobjc.A.dylib||objc_exception_throw + 56|
|3||CoreFoundation||-[NSObject(NSObject) doesNotRecognizeSelector:] + 216|
|4||CoreFoundation||___forwarding___ + 924|
|5||CoreFoundation||_CF_forwarding_prep_0 + 88|
|12||UIKit||-[UIApplication sendEvent:] + 260|
|22||libdyld.dylib||start + 0|
This happended on an Iphone 6+, IOS 8.3. I am using Optimizely in combination with Amplitude.
Any advice on why this happens and what the fix is?
@nicolas Thanks for reaching out! It'd be great if you can provide more information about the crash you are seeing in your app, including:
- Do you have steps you can provide on how to reproduce this issue?
- What kind of experiment did you implement? (i.e. Visual Editor, Live Variable, or Code Block change)
- How often do you see these crashes happening?
I'll reach out to you separately via e-mail to follow up and see if we can find the root cause of what you're seeing.
@dgriffin Thanks for reaching out! This issue is often not related to the Optimizely SDK. Optimizely will often show up in the crash log (because we do swizzling in the app) but may not actually have caused the crash. How Optimizely's SDK works is that it sees events that are sent and stores ones that match any tap goals that you have set up in your app. After that, the SDK passes through to the original sendEvents method in UIWindow. You can view the sendEvent that we swizzle from UIWindow here. It's possible that somehow the window is being released before their transition is over. That's something to look at in the code.
In the meantime, I'll follow up with you over e-mail to see if we can find the root cause of the issue you're seeing.