OneSignal-iOS-SDK icon indicating copy to clipboard operation
OneSignal-iOS-SDK copied to clipboard

[Crashlytics] Crash on OSInAppMessageViewController

Open spirit-jsb opened this issue 4 years ago • 14 comments

Description:

sorry i have same crash in my app, and i'm not passed nil on the closure handleNotificationAction. #661

it's firebase crashlytics infos

Fatal Exception: NSGenericException
Unable to activate constraint with anchors <NSLayoutDimension:0x283b74f00 "OSInAppMessageView:0x114228430.height"> and <NSLayoutDimension:0x283b70300 "UILayoutGuide:0x281803020'UIViewSafeAreaLayoutGuide'.height"> because they have no common ancestor. Does the constraint or its anchors reference items in different view hierarchies? That's illegal.
Fatal Exception: NSGenericException
0  CoreFoundation                 0x18a94e878 __exceptionPreprocess
1  libobjc.A.dylib                0x19eea4c50 objc_exception_throw
2  CoreAutoLayout                 0x19f15f158 -[NSLayoutConstraint setActive:]
3  Lit Live                       0x1048b4574 -[OSInAppMessageViewController addConstraintsForMessage]
4  Lit Live                       0x1048b6cf0 __83-[OSInAppMessageViewController viewWillTransitionToSize:withTransitionCoordinator:]_block_invoke_2
5  Lit Live                       0x1048b25bc __61-[OSInAppMessageView resetWebViewToMaxBoundsAndResizeHeight:]_block_invoke
6  WebKit                         0x196e61804 WTF::Detail::CallableWrapper<-[WKWebView _evaluateJavaScript:asAsyncFunction:withSourceURL:withArguments:forceUserGesture:inFrame:inWorld:completionHandler:]::$_9, void, API::SerializedScriptValue*, WTF::Optional<WebCore::ExceptionDetails>, WebKit::CallbackBase::Error>::call(API::SerializedScriptValue*, WTF::Optional<WebCore::ExceptionDetails>, WebKit::CallbackBase::Error)
7  WebKit                         0x196f509e4 WTF::Function<void (API::SerializedScriptValue*, WTF::Optional<WebCore::ExceptionDetails>, WebKit::CallbackBase::Error)>::operator()(API::SerializedScriptValue*, WTF::Optional<WebCore::ExceptionDetails>, WebKit::CallbackBase::Error) const
8  WebKit                         0x196f5e95c WebKit::GenericCallback<API::SerializedScriptValue*, WTF::Optional<WebCore::ExceptionDetails> >::performCallbackWithReturnValue(API::SerializedScriptValue*, WTF::Optional<WebCore::ExceptionDetails>)
9  WebKit                         0x196f5e7d0 WebKit::WebPageProxy::scriptValueCallback(IPC::DataReference const&, WTF::Optional<WebCore::ExceptionDetails>, WebKit::CallbackID)
10 WebKit                         0x197226cf8 WebKit::WebPageProxy::didReceiveMessage(IPC::Connection&, IPC::Decoder&)
11 WebKit                         0x196c5285c IPC::MessageReceiverMap::dispatchMessage(IPC::Connection&, IPC::Decoder&)
12 WebKit                         0x196f812f0 WebKit::WebProcessProxy::didReceiveMessage(IPC::Connection&, IPC::Decoder&)
13 WebKit                         0x196c35dec IPC::Connection::dispatchMessage(std::__1::unique_ptr<IPC::Decoder, std::__1::default_delete<IPC::Decoder> >)
14 WebKit                         0x196c356f4 IPC::Connection::dispatchIncomingMessages()
15 JavaScriptCore                 0x194b183c8 WTF::RunLoop::performWork()
16 JavaScriptCore                 0x194b190b0 WTF::RunLoop::performWork(void*)
17 CoreFoundation                 0x18a8ca76c __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__
18 CoreFoundation                 0x18a8ca668 __CFRunLoopDoSource0
19 CoreFoundation                 0x18a8c9960 __CFRunLoopDoSources0
20 CoreFoundation                 0x18a8c3a8c __CFRunLoopRun
21 CoreFoundation                 0x18a8c321c CFRunLoopRunSpecific
22 GraphicsServices               0x1a1942784 GSEventRunModal
23 UIKitCore                      0x18d2fc200 -[UIApplication _run]
24 UIKitCore                      0x18d301a74 UIApplicationMain
25 Lit Live                       0x1045f18dc main + 14 (AppDelegate.swift:14)
26 libdyld.dylib                  0x18a5836c0 start

Environment

spirit-jsb avatar Nov 30 '20 08:11 spirit-jsb

Hello what version are you using and have you been able to reproduce the issue?

emawby avatar Dec 08 '20 01:12 emawby

@emawby version 2.16.0, sorry i can't reproduct the issue.... and all the crash information is coming from Firebase.

spirit-jsb avatar Dec 15 '20 02:12 spirit-jsb

We are experiencing the same crash on version 3.1.1. It happens a lot in production, but we can't reproduce it. The app is written with SwiftUI, which causes a lot of peculiar problems, so that might be related.

EgorKomarov avatar Mar 27 '21 16:03 EgorKomarov

We updated to version 3.3.0 and the crash still reproduces.

EgorKomarov avatar Mar 31 '21 15:03 EgorKomarov

We just implemented OS, but are not in production yet and had the same crash. We are on version 3.6.0 and the app is also written in SwiftUI. I have not been able to reproduce it yet, unfortunately.

mikeaymard avatar Jul 27 '21 18:07 mikeaymard

We are experiencing this crash as well. Is there any movement on this? It's frustrating paying for a service that is causing a poor user experience.

When we started seeing the crash reports correlates with the use of an in app message. The in app message has 7 button and is essentially a small survey we show some of our users.

According to the crash reports this is happening on several flavors of iOS 14. Some of the devices include iPhone 11, iPad mini 4, and iPhone XR.

JasonNeurotrack avatar Aug 12 '21 15:08 JasonNeurotrack

We've been experiencing this crash for many months, too. @emawby, is the "Need More Information" label on this issue still relevant? Thank you.

5lava avatar Aug 12 '21 23:08 5lava

@emawby Like the others we're experiencing crashes in OSInAppMessageViewController. We have not reproduced but are seeing it in Crashlytics. The exception is:

Fatal Exception: NSGenericException Unable to activate constraint with anchors <NSLayoutDimension:0x281f45e00 "OSInAppMessageView:0x161386de0.height"> and <NSLayoutDimension:0x281f45d00 "UILayoutGuide:0x283cd8620'UIViewSafeAreaLayoutGuide'.height"> because they have no common ancestor. Does the constraint or its anchors reference items in different view hierarchies? That's illegal.

So it looks like you are activating a constraint between two entities that do not share a common ancestor. Please prioritize this issue as we no longer feel confident using one of the main features that we integrated OneSignal to use. Please provide a status update on this issue.

To be thorough the stack trace is:

Fatal Exception: NSGenericException 0 CoreFoundation 0x18782a708 __exceptionPreprocess 1 libobjc.A.dylib 0x19c3347a8 objc_exception_throw 2 CoreAutoLayout 0x19c5da710 -[NSLayoutConstraint setActive:] 3 Jump Rope Training | Crossrope 0x102790704 -[OSInAppMessageViewController addConstraintsForMessage] + 326 (OSInAppMessageViewController.m:326) 4 Jump Rope Training | Crossrope 0x1027930b4 __83-[OSInAppMessageViewController viewWillTransitionToSize:withTransitionCoordinator:]_block_invoke_2 + 749 (OSInAppMessageViewController.m:749) 5 Jump Rope Training | Crossrope 0x10279bb2c __61-[OSInAppMessageView resetWebViewToMaxBoundsAndResizeHeight:]_block_invoke + 150 (OSInAppMessageView.m:150) 6 WebKit 0x193fb2118 WTF::Detail::CallableWrapper<WebKit::WebPageProxy::runJavaScriptInFrameInScriptWorld(WebCore::RunJavaScriptParameters&&, WTF::Optional<WTF::ObjectIdentifierWebCore::FrameIdentifierType >, API::ContentWorld&, WTF::CompletionHandler<void (std::experimental::fundamentals_v3::expected<WTF::RefPtr<API::SerializedScriptValue, WTF::RawPtrTraitsAPI::SerializedScriptValue, WTF::DefaultRefDerefTraitsAPI::SerializedScriptValue >, WebCore::ExceptionDetails>&&)>&&)::$_19, void, IPC::ArrayReference<unsigned char, 18446744073709551615ul>&&, WTF::OptionalWebCore::ExceptionDetails&&>::call(IPC::ArrayReference<unsigned char, 18446744073709551615ul>&&, WTF::OptionalWebCore::ExceptionDetails&&) 7 WebKit 0x19426c7ac Messages::WebPage::RunJavaScriptInFrameInScriptWorld::callReply(IPC::Decoder&, WTF::CompletionHandler<void (IPC::ArrayReference<unsigned char, 18446744073709551615ul>&&, WTF::OptionalWebCore::ExceptionDetails&&)>&&) 8 WebKit 0x193fb1da4 WTF::Detail::CallableWrapper<void IPC::MessageSender::sendWithAsyncReply<Messages::WebPage::RunJavaScriptInFrameInScriptWorld, WebKit::WebPageProxy::runJavaScriptInFrameInScriptWorld(WebCore::RunJavaScriptParameters&&, WTF::Optional<WTF::ObjectIdentifierWebCore::FrameIdentifierType >, API::ContentWorld&, WTF::CompletionHandler<void (std::experimental::fundamentals_v3::expected<WTF::RefPtr<API::SerializedScriptValue, WTF::RawPtrTraitsAPI::SerializedScriptValue, WTF::DefaultRefDerefTraitsAPI::SerializedScriptValue >, WebCore::ExceptionDetails>&&)>&&)::$19>(Messages::WebPage::RunJavaScriptInFrameInScriptWorld&&, WebKit::WebPageProxy::runJavaScriptInFrameInScriptWorld(WebCore::RunJavaScriptParameters&&, WTF::Optional<WTF::ObjectIdentifierWebCore::FrameIdentifierType >, API::ContentWorld&, WTF::CompletionHandler<void (std::experimental::fundamentals_v3::expected<WTF::RefPtr<API::SerializedScriptValue, WTF::RawPtrTraitsAPI::SerializedScriptValue, WTF::DefaultRefDerefTraitsAPI::SerializedScriptValue >, WebCore::ExceptionDetails>&&)>&&)::$19&&, unsigned long long, WTF::OptionSetIPC::SendOption)::'lambda'(IPC::Decoder*), void, IPC::Decoder*>::call(IPC::Decoder*) 9 WebKit 0x193f1d898 WTF::Detail::CallableWrapper<WebKit::AuxiliaryProcessProxy::sendMessage(std::__1::unique_ptr<IPC::Encoder, std::__1::default_deleteIPC::Encoder >, WTF::OptionSetIPC::SendOption, WTF::Optional<std::__1::pair<WTF::CompletionHandler<void (IPC::Decoder*)>, unsigned long long> >&&, WebKit::AuxiliaryProcessProxy::ShouldStartProcessThrottlerActivity)::$1, void, IPC::Decoder*>::call(IPC::Decoder*) 10 WebKit 0x193c45f34 IPC::Connection::dispatchMessage(std::__1::unique_ptr<IPC::Decoder, std::__1::default_deleteIPC::Decoder >) 11 WebKit 0x193c455ec IPC::Connection::dispatchIncomingMessages() 12 JavaScriptCore 0x191baa160 WTF::RunLoop::performWork() 13 JavaScriptCore 0x191bab130 WTF::RunLoop::performWork(void*) 14 CoreFoundation 0x1877a4990 CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION 15 CoreFoundation 0x1877a488c __CFRunLoopDoSource0 16 CoreFoundation 0x1877a3b90 __CFRunLoopDoSources0 17 CoreFoundation 0x18779db70 __CFRunLoopRun 18 CoreFoundation 0x18779d308 CFRunLoopRunSpecific 19 GraphicsServices 0x19ee20734 GSEventRunModal 20 UIKitCore 0x18a21b75c -[UIApplication run] 21 UIKitCore 0x18a220fcc UIApplicationMain 22 libswiftUIKit.dylib 0x19b5a224c UIApplicationMain(::::)

Good Day

benroaman avatar Aug 13 '21 14:08 benroaman

We are working on a fix to guarantee that the view hierarchy is correct before attempting to add constraints, but we still have not been able to reproduce this issue internally, so if anyone has been able to reproduce this please let us know!

emawby avatar Aug 24 '21 16:08 emawby

@emawby Thank you for the update!

benroaman avatar Aug 24 '21 17:08 benroaman

Any update on this? Getting this issue now too.

kierandesmond avatar Jan 03 '22 15:01 kierandesmond

@kierandesmond Thanks for reporting, this should have been fixed in version OneSignal 3.6.2.

If you are still seeing this issue could you let us know if you are using SwiftUI?

jkasten2 avatar Jan 04 '22 19:01 jkasten2

Hi Josh,

We are using 4.3.3 of OneSignal – react native. We aren’t using SwiftUI no.

Thanks

[sweep-logo-blue-sig] Kieran Desmond Chief Technology Officer a: Sweep | 11 Herbert Street | Dublin 2 e: @.*** w: sweep.iehttp://sweep.ie/ m: +353 879254256

From: Josh Kasten @.> Date: Tuesday, 4 January 2022 at 20:25 To: OneSignal/OneSignal-iOS-SDK @.> Cc: Kieran Desmond @.>, Mention @.> Subject: Re: [OneSignal/OneSignal-iOS-SDK] [Crashlytics] Crash on OSInAppMessageViewController (#819)

@kierandesmondhttps://github.com/kierandesmond Thanks for reporting, this should have been fixed in version OneSignal 3.6.2https://github.com/OneSignal/OneSignal-iOS-SDK/releases/tag/3.6.2.

If you are still seeing this issue could you let us know if you are using SwiftUI?

— Reply to this email directly, view it on GitHubhttps://github.com/OneSignal/OneSignal-iOS-SDK/issues/819#issuecomment-1005105896, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AIENJUXOC2VRERKV7HT4EILUUNCRXANCNFSM4UHHVINQ. You are receiving this because you were mentioned.Message ID: @.***>

kierandesmond avatar Jan 06 '22 09:01 kierandesmond

@kierandesmond Does the stack trace look identical to the trace in the first post? If not could you post the stack trace you are getting?

emawby avatar Jan 13 '22 19:01 emawby

Closing due to inactivity

emawby avatar Mar 23 '23 17:03 emawby