iOS DAI Fatal Exception: UIViewControllerHierarchyInconsistency

314 views
Skip to first unread message

Eric Douglass

unread,
May 27, 2021, 10:13:47 PM5/27/21
to Interactive Media Ads SDK
Our app has been getting these types of crashes since the 3.12.0 that required a view controller as an initialization argument for IMAAdDisplayContainer. I was able to reproduce this crash in the Basic Example app that is part of https://github.com/googleads/googleads-ima-ios-dai.

This was done using the example app and on a iPhone XS Max with Xcode 12.4. I stared the app and then played the video. I would then start instruments to monitor memory allocations. Eventually the app would crash with this error.

Fatal Exception: UIViewControllerHierarchyInconsistency
A view can only be associated with at most one view controller at a time! View <IMAWKWebView: 0x120a28b40; frame = (0 0; 414 233); opaque = NO; autoresize = W+H; layer = <CALayer: 0x2802e81c0>> is associated with <IMAWebUIViewController: 0x10b7b9a90>. Clear this association before associating this view with <IMAWebUIViewController: 0x10b4471c0>.

I have also added the partial crash log below

Thanks,
Eric.

Incident Identifier: 00F2931C-4ABC-47BB-90F7-AE0423C8C4B1
CrashReporter Key:   698323f5a8e97cbcc555ef20207d4ee74e13538e
Hardware Model:      iPhone11,6
Process:             BasicExample [5350]
Path:                /private/var/containers/Bundle/Application/2FDB07AC-4BA3-4D6A-B21B-91DB8D5625A5/BasicExample.app/BasicExample
Identifier:          com.google.ima.BasicExampleaaa
Version:             1 (1.0)
Code Type:           ARM-64 (Native)
Role:                Foreground
Parent Process:      launchd [1]
Coalition:           com.google.ima.BasicExampleaaa [1284]


Date/Time:           2021-05-27 19:38:50.3867 -0500
Launch Time:         2021-05-27 19:30:48.4113 -0500
OS Version:          iPhone OS 14.0 (18A373)
Release Type:        User
Baseband Version:    3.00.01
Report Version:      104

Exception Type:  EXC_BREAKPOINT (SIGTRAP)
Exception Codes: 0x0000000000000001, 0x000000018a8c4c54
Termination Signal: Trace/BPT trap: 5
Termination Reason: Namespace SIGNAL, Code 0x5
Terminating Process: exc handler [5350]
Triggered by Thread:  0

Application Specific Information:
abort() called

Last Exception Backtrace:
0   CoreFoundation                0x1817c25ac __exceptionPreprocess + 220
1   libobjc.A.dylib                0x19583c42c objc_exception_throw + 59
2   CoreFoundation                0x1816bea9c +[NSException raise:format:] + 111
3   UIKitCore                      0x184602b24 -[UIView+ 17447716 (Internal) _setViewDelegate:] + 159
4   UIKitCore                      0x1839e9e74 +[UIViewController setViewController:forView:] + 51
5   UIKitCore                      0x1839e2478 -[UIViewController setView:] + 467
6   UIKitCore                      0x1839e1b20 -[UIViewController loadViewIfRequired] + 199
7   UIKitCore                      0x1839e21d8 -[UIViewController view] + 31
8   GoogleInteractiveMediaAds      0x104ae4918 0x104abc000 + 166168
9   UIKitCore                      0x1839dd678 -[UIViewController _sendViewDidLoadWithAppearanceProxyObjectTaggingEnabled] + 107
10  UIKitCore                      0x1839e1e14 -[UIViewController loadViewIfRequired] + 955
11  UIKitCore                      0x1839e21d8 -[UIViewController view] + 31
12  GoogleInteractiveMediaAds      0x104ad82b8 0x104abc000 + 115384
13  GoogleInteractiveMediaAds      0x104ace7fc 0x104abc000 + 75772
14  CoreFoundation                0x181721764 __CFNOTIFICATIONCENTER_IS_CALLING_OUT_TO_AN_OBSERVER__ + 27
15  CoreFoundation                0x181721718 ___CFXRegistrationPost_block_invoke + 51
16  CoreFoundation                0x181720cd4 _CFXRegistrationPost + 439
17  CoreFoundation                0x1817206a0 _CFXNotificationPost + 703
18  Foundation                    0x1829b45f4 -[NSNotificationCenter postNotificationName:object:userInfo:] + 63
19  GoogleInteractiveMediaAds      0x104aeb57c 0x104abc000 + 193916
20  GoogleInteractiveMediaAds      0x104aea980 0x104abc000 + 190848
21  GoogleInteractiveMediaAds      0x104aea868 0x104abc000 + 190568
22  GoogleInteractiveMediaAds      0x104aea164 0x104abc000 + 188772
23  GoogleInteractiveMediaAds      0x104ac3c5c 0x104abc000 + 31836
24  GoogleInteractiveMediaAds      0x104ae98e0 0x104abc000 + 186592
25  WebKit                        0x18d9fd514 ScriptMessageHandlerDelegate::didPostMessage+ 2426132 (WebKit::WebPageProxy&, WebKit::FrameInfoData&&, API::ContentWorld&, WebCore::SerializedScriptValue&) + 231
26  WebKit                        0x18dbfa80c WebKit::WebUserContentControllerProxy::didPostMessage(WTF::ObjectIdentifier<WebKit::WebPageProxyIdentifierType>, WebKit::FrameInfoData&&, unsigned long long, IPC::DataReference const&, WTF::CompletionHandler<void + 4511756 (IPC::DataReference const&, WTF::String const&)>&&) + 559
27  WebKit                        0x18de2993c WebKit::WebUserContentControllerProxy::didReceiveMessage+ 6801724 (IPC::Connection&, IPC::Decoder&) + 2507
28  WebKit                        0x18d7fa1f8 IPC::MessageReceiverMap::dispatchMessage+ 315896 (IPC::Connection&, IPC::Decoder&) + 123
29  WebKit                        0x18db1b9a8 WebKit::WebProcessProxy::didReceiveMessage+ 3598760 (IPC::Connection&, IPC::Decoder&) + 39
30  WebKit                        0x18d7dddc8 IPC::Connection::dispatchMessage+ 200136 (std::__1::unique_ptr<IPC::Decoder, std::__1::default_delete<IPC::Decoder> >) + 655
31  WebKit                        0x18d7dd6d0 IPC::Connection::dispatchIncomingMessages+ 198352 () + 459
32  JavaScriptCore                0x18b7773b4 WTF::RunLoop::performWork+ 15070132 () + 483
33  JavaScriptCore                0x18b777fb4 WTF::RunLoop::performWork+ 15073204 (void*) + 35
34  CoreFoundation                0x18173f81c __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 27
35  CoreFoundation                0x18173f718 __CFRunLoopDoSource0 + 207
36  CoreFoundation                0x18173ea28 __CFRunLoopDoSources0 + 267
37  CoreFoundation                0x181738d20 __CFRunLoopRun + 823
38  CoreFoundation                0x1817384bc CFRunLoopRunSpecific + 599
39  GraphicsServices              0x1981bd820 GSEventRunModal + 163
40  UIKitCore                      0x1840dc734 -[UIApplication _run] + 1071
41  UIKitCore                      0x1840e1e10 UIApplicationMain + 167
42  BasicExample                  0x104604040 main + 32832 (main.m:7)
43  libdyld.dylib                  0x1813ffe60 start + 3

IMA SDK

unread,
May 28, 2021, 2:10:09 AM5/28/21
to ecd...@gmail.com, ima...@googlegroups.com
Hi Eric,

Thank you for raising this to us.

With regard to your concern, I could see that you're using a SDK version which is quite old. Would it be possible for you to upgrade to the latest version of the SDK, then let me know if you still encounter the crash?

Regards,
Google Logo
Teejay Wennie Pimentel
IMA SDK Team
 


ref:_00D1U1174p._5004Q2HyWfc:ref

Eric Douglass

unread,
May 28, 2021, 10:55:04 AM5/28/21
to Interactive Media Ads SDK
Here is the crash running on 3.14.3 using the basic example app.

*** Terminating app due to uncaught exception 'UIViewControllerHierarchyInconsistency', reason: 'A view can only be associated with at most one view controller at a time! View <IMAWKWebView: 0x101b06090; frame = (0 0; 0 0); opaque = NO; autoresize = W+H; layer = <CALayer: 0x283c3bc40>> is associated with <IMAWebUIViewController: 0x101b26b10>. Clear this association before associating this view with <IMAWebUIViewController: 0x101c1eb30>.'
terminating with uncaught exception of type NSException

Incident Identifier: 2828458E-45BE-4C5B-9164-3D9753FEFA07
CrashReporter Key:   698323f5a8e97cbcc555ef20207d4ee74e13538e
Hardware Model:      iPhone11,6
Process:             BasicExample [6381]
Path:                /private/var/containers/Bundle/Application/A3DE7F42-CFA7-47C8-85E6-B64131E879FD/BasicExample.app/BasicExample
Identifier:          com.google.ima.BasicExampleaaa
Version:             1 (1.0)
Code Type:           ARM-64 (Native)
Role:                Foreground
Parent Process:      launchd [1]
Coalition:           com.google.ima.BasicExampleaaa [1284]


Date/Time:           2021-05-28 09:53:36.3519 -0500
Launch Time:         2021-05-28 09:48:34.5538 -0500
OS Version:          iPhone OS 14.0 (18A373)
Release Type:        User
Baseband Version:    3.00.01
Report Version:      104

Exception Type:  EXC_CRASH (SIGABRT)
Exception Codes: 0x0000000000000000, 0x0000000000000000
Exception Note:  EXC_CORPSE_NOTIFY
Triggered by Thread:  0

Application Specific Information:
abort() called

Last Exception Backtrace:
0   CoreFoundation                0x1817c25ac __exceptionPreprocess + 220
1   libobjc.A.dylib                0x19583c42c objc_exception_throw + 59
2   CoreFoundation                0x1816bea9c +[NSException raise:format:] + 111
3   UIKitCore                      0x184602b24 -[UIView+ 17447716 (Internal) _setViewDelegate:] + 159
4   UIKitCore                      0x1839e9e74 +[UIViewController setViewController:forView:] + 51
5   UIKitCore                      0x1839e2478 -[UIViewController setView:] + 467
6   UIKitCore                      0x1839e1b20 -[UIViewController loadViewIfRequired] + 199
7   UIKitCore                      0x1839e21d8 -[UIViewController view] + 31
8   GoogleInteractiveMediaAds      0x10133c918 0x101314000 + 166168
9   UIKitCore                      0x1839dd678 -[UIViewController _sendViewDidLoadWithAppearanceProxyObjectTaggingEnabled] + 107
10  UIKitCore                      0x1839e1e14 -[UIViewController loadViewIfRequired] + 955
11  UIKitCore                      0x1839e21d8 -[UIViewController view] + 31
12  GoogleInteractiveMediaAds      0x1013302b8 0x101314000 + 115384
13  GoogleInteractiveMediaAds      0x1013267fc 0x101314000 + 75772
14  CoreFoundation                0x181721764 __CFNOTIFICATIONCENTER_IS_CALLING_OUT_TO_AN_OBSERVER__ + 27
15  CoreFoundation                0x181721718 ___CFXRegistrationPost_block_invoke + 51
16  CoreFoundation                0x181720cd4 _CFXRegistrationPost + 439
17  CoreFoundation                0x1817206a0 _CFXNotificationPost + 703
18  Foundation                    0x1829b45f4 -[NSNotificationCenter postNotificationName:object:userInfo:] + 63
19  GoogleInteractiveMediaAds      0x10134357c 0x101314000 + 193916
20  GoogleInteractiveMediaAds      0x101342980 0x101314000 + 190848
21  GoogleInteractiveMediaAds      0x101342868 0x101314000 + 190568
22  GoogleInteractiveMediaAds      0x101342164 0x101314000 + 188772
23  GoogleInteractiveMediaAds      0x10131bc5c 0x101314000 + 31836
24  GoogleInteractiveMediaAds      0x1013418e0 0x101314000 + 186592
25  WebKit                        0x18d9fd514 ScriptMessageHandlerDelegate::didPostMessage+ 2426132 (WebKit::WebPageProxy&, WebKit::FrameInfoData&&, API::ContentWorld&, WebCore::SerializedScriptValue&) + 231
26  WebKit                        0x18dbfa80c WebKit::WebUserContentControllerProxy::didPostMessage(WTF::ObjectIdentifier<WebKit::WebPageProxyIdentifierType>, WebKit::FrameInfoData&&, unsigned long long, IPC::DataReference const&, WTF::CompletionHandler<void + 4511756 (IPC::DataReference const&, WTF::String const&)>&&) + 559
27  WebKit                        0x18de2993c WebKit::WebUserContentControllerProxy::didReceiveMessage+ 6801724 (IPC::Connection&, IPC::Decoder&) + 2507
28  WebKit                        0x18d7fa1f8 IPC::MessageReceiverMap::dispatchMessage+ 315896 (IPC::Connection&, IPC::Decoder&) + 123
29  WebKit                        0x18db1b9a8 WebKit::WebProcessProxy::didReceiveMessage+ 3598760 (IPC::Connection&, IPC::Decoder&) + 39
30  WebKit                        0x18d7dddc8 IPC::Connection::dispatchMessage+ 200136 (std::__1::unique_ptr<IPC::Decoder, std::__1::default_delete<IPC::Decoder> >) + 655
31  WebKit                        0x18d7dd778 IPC::Connection::dispatchIncomingMessages+ 198520 () + 627
32  JavaScriptCore                0x18b7773b4 WTF::RunLoop::performWork+ 15070132 () + 483
33  JavaScriptCore                0x18b777fb4 WTF::RunLoop::performWork+ 15073204 (void*) + 35
34  CoreFoundation                0x18173f81c __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 27
35  CoreFoundation                0x18173f718 __CFRunLoopDoSource0 + 207
36  CoreFoundation                0x18173ea28 __CFRunLoopDoSources0 + 267
37  CoreFoundation                0x181738d20 __CFRunLoopRun + 823
38  CoreFoundation                0x1817384bc CFRunLoopRunSpecific + 599
39  GraphicsServices              0x1981bd820 GSEventRunModal + 163
40  UIKitCore                      0x1840dc734 -[UIApplication _run] + 1071
41  UIKitCore                      0x1840e1e10 UIApplicationMain + 167
42  BasicExample                  0x100f58040 main + 32832 (main.m:7)
43  libdyld.dylib                  0x1813ffe60 start + 3

IMA SDK

unread,
May 28, 2021, 3:37:03 PM5/28/21
to ecd...@gmail.com, ima...@googlegroups.com
Hi Eric,

Do you see this happening without monitoring? Would a user of an app experience this crash? I ran the Basic Example app with SDK version 3.14.3 in Xcode 12.5 with Profiler recording in an Iphone 8 plus and this crash didn't occur. 

Regards,

Google Logo
Aryeh Baker
IMA SDK Team
 


ref:_00D1U1174p._5004Q2HyWfc:ref

Eric Douglass

unread,
May 28, 2021, 3:56:38 PM5/28/21
to IMA SDK, ima...@googlegroups.com
I believe so. From our firebase crashlytics we have numerous crashes with this, also I have seen this crash posted multiple times on these forums.

IMA SDK

unread,
May 30, 2021, 11:37:57 PM5/30/21
to ecd...@gmail.com, ima...@googlegroups.com

Hi Eric,

 

To reiterate what Aryeh asked, do you see this happening without monitoring? How do you exactly do and implement monitoring? For us to investigate further, could you please send us a sample project file implementation along with the screen recording of the behavior?

Regards,

Google Logo
Michael Angelo Legaspi
IMA SDK Team
 


ref:_00D1U1174p._5004Q2HyWfc:ref

Eric Douglass

unread,
Jun 1, 2021, 1:18:45 PM6/1/21
to Interactive Media Ads SDK
The only way I have been able to reproduce this error is with instruments running watching memory allocations. However, I have had testers report this crash through testflight. In addition our crashlytics shows this crash occurring in production builds. I have created a recording of reproducing the crash and have sent it to imate...@gmail.com
Screen Shot 2021-06-01 at 11.56.10 AM.png

IMA SDK

unread,
Jun 1, 2021, 3:50:26 PM6/1/21
to ecd...@gmail.com, ima...@googlegroups.com
Hi Eric,

Thank you for the additional information.Seeing as how we have not been able to replicate this on our side with the basic sample app. Along with the fact that yiu have been using other applications to track this behavior makes it difficult to find what the issue is. If you can share with us your sample app for us to test with we can try to look further into this. Also we would suggest to test without any extra add ons as they could be causing the issue. The other thing that we need to look into is why the error is saying that you are using more the one UIController. We would need to make sure that there is not more than one in use at a given time.

Also as a side note to this, one of the other things I have seen is that to make sure if you were using code from another section and reusing it in the same spot as the ad, that you might have mistakenly brought in another ViewController.

Regards,
Google Logo
William Pe4scherine
IMA SDK Team
 


ref:_00D1U1174p._5004Q2HyWfc:ref

IMA SDK

unread,
Jun 2, 2021, 3:07:32 PM6/2/21
to ecd...@gmail.com, ima...@googlegroups.com
Hi Eric,

We were able to replicate this issue. I raised this with my team, and we will get back to you as soon as possible.

Regards,

Google Logo
Aryeh Baker
IMA SDK Team
 


ref:_00D1U1174p._5004Q2HyWfc:ref

Eric Douglass

unread,
Jun 30, 2021, 1:39:50 PM6/30/21
to Interactive Media Ads SDK
Hello, I am looking for an update on this issue.

IMA SDK

unread,
Jun 30, 2021, 4:27:04 PM6/30/21
to ecd...@gmail.com, ima...@googlegroups.com
Hi Eric,

There are no updates available, we will get back to you as soon as possible.

IMA SDK

unread,
Aug 12, 2021, 2:02:50 AM8/12/21
to ecd...@gmail.com, ima...@googlegroups.com

Hi Eric,

 

I hope you are doing fine.

 

Our team circled back on this and wants to know if you are still encountering this issue? There seems to be some adjustments and modifications done that is now reflected on the latest version 3.14.4. Would it be possible for you to update to the latest version and see if this would still occur?

Regards,

Google Logo
Michael Angelo Legaspi
IMA SDK Team
 


ref:_00D1U1174p._5004Q2HyWfc:ref

Eric Douglass

unread,
Sep 7, 2021, 12:43:37 PM9/7/21
to Interactive Media Ads SDK
Hello,
Yes, we are still seeing this issue on the latest 3.14.4 SDK.

IMA SDK

unread,
Sep 7, 2021, 5:12:25 PM9/7/21
to ecd...@gmail.com, ima...@googlegroups.com
Hi Eric,

Thank you for reaching back to us with this concern still. Is it the exact same? Such that nothing seemed to have been fixed? If so please let us know more if something else changed, so that we can bring this back to our team and let them know.

Regards,
Google Logo
William Pescherine
IMA SDK Team
 


ref:_00D1U1174p._5004Q2HyWfc:ref

IMA SDK

unread,
May 23, 2022, 5:40:10 AM5/23/22
to ecd...@gmail.com, ima...@googlegroups.com

Hello Eric,

 

Hope you are doing fine.

 

Just want to get back here and let you know that a fixed for this has been released. Kindly update to the latest version should you still encounter the same issue.

Regards,

Google Logo
Michael Angelo
IMA SDK Team
 


ref:_00D1U1174p._5004Q2HyWfc:ref

IMA SDK

unread,
May 25, 2022, 3:01:01 AM5/25/22
to manivan...@viacomcbs.com, ima...@googlegroups.com, ecd...@gmail.com

Hello Manivanna,

 

Thank you for responding back to us. I believe the issue was resolved on our latest iOS SDK v3.16.3. However, please do let us know should the issue persist on your end and provide more details.

Regards,

Reply all
Reply to author
Forward
0 new messages