Fatal Exception: UIViewControllerHierarchyInconsistency | IOS IMA sdk

783 views
Skip to first unread message

as0...@gmail.com

unread,
Jan 18, 2021, 12:19:40 AM1/18/21
to Interactive Media Ads SDK
Hi,
after updating ios IMA SDK to 3.13.0 from 3.11.4 we are getting this crash.

Fatal Exception: UIViewControllerHierarchyInconsistency
A view can only be associated with at most one view controller at a time! View <IMAWKWebView: 0x102f094e0; frame = (0 0; 667 375); opaque = NO; autoresize = W+H; layer = <CALayer: 0x2805f12e0>> is associated with <IMAWebUIViewController: 0x102f9fd20>. Clear this association before associating this view with <IMAWebUIViewController: 0x102fdc0a0>.
-[NSCache init]
keyboard_arrow_down

all these viewControllers are part of IMA sdk and added in view Hierarchy when ads start playing.
we have not changed anything at our end apart from the changes required by IMA sdk, mentioned in its release notes.

why this crash is coming?
please look into this as number of crashes is increasing.

Thanks,
Ashish Mishra






IMA SDK

unread,
Jan 18, 2021, 2:54:23 AM1/18/21
to as0...@gmail.com, ima...@googlegroups.com

Hi Ashish,

Thank you for reaching out to us. Were you able to reproduce this issue with one of our sample applications? If yes, kindly share with us the sample project file that demonstrates the error, and the steps to replicate the issue so that we can investigate further. You can send the sample project file to our testing alias for our reference:  imate...@gmail.co


Regards,


Google Logo
Sherwin Diesta
IMA SDK Team
 


ref:_00D1U1174p._5004Q2B16Lm:ref

IMA SDK

unread,
Jan 18, 2021, 2:58:33 AM1/18/21
to as0...@gmail.com, ima...@googlegroups.com

Hi Ashish,

Sorry for the typo, here’s the correct testing alias you can use: imate...@gmail.com

as0...@gmail.com

unread,
Jan 20, 2021, 12:59:35 AM1/20/21
to Interactive Media Ads SDK
Hi,

We are not able to reproduce the issue at our end. This crash is showing up on crashlytics after we updated IMA version from 3.11.4 to 3.13.0.

Fatal Exception: UIViewControllerHierarchyInconsistency
A view can only be associated with at most one view controller at a time! View <IMAWKWebView: 0x102f094e0; frame = (0 0; 667 375); opaque = NO; autoresize = W+H; layer = <CALayer: 0x2805f12e0>> is associated with <IMAWebUIViewController: 0x102f9fd20>. Clear this association before associating this view with <IMAWebUIViewController: 0x102fdc0a0>.
-[NSCache init]
keyboard_arrow_down

Ui view names mentioned here are added by IMA sdk while playing video ads.
View <IMAWKWebView: 0x102f094e0; 
<IMAWebUIViewController: 0x102fdc0a0
<IMAWebUIViewController: 0x102f9fd20>

We do not hold references to these files, we did not change anything at our end while updating IMA version.
In the meantime i am trying to reproduce it on sample Apps.

Kindly look into changes done in IMA SDK with version update, which might be causing the issue.

Thanks,
Ashish

Gourav Saxena

unread,
Jan 20, 2021, 1:38:34 AM1/20/21
to as0...@gmail.com, Interactive Media Ads SDK
Hi Sherwin,

I am facing this issue in Android as well. Here is the ticket. I am waiting for the response from William.

Regards,
Gourav


--
You received this message because you are subscribed to the Google Groups "Interactive Media Ads SDK" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ima-sdk+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ima-sdk/7bdf4dba-405d-4ecd-807e-8f210ae03886n%40googlegroups.com.

Gourav Saxena

unread,
Jan 20, 2021, 1:39:38 AM1/20/21
to as0...@gmail.com, Interactive Media Ads SDK
I was able to reproduce this issue on change media, so I implemented in IMA AdvancedExample.

Regards,
Gourav

IMA SDK

unread,
Jan 20, 2021, 4:58:30 AM1/20/21
to gourav...@gmail.com, ima...@googlegroups.com, as0...@gmail.com

Hi Ashish,

Thank you for your message. Looking forward to the result of your testing using our sample applications. Let me know if you can reproduce the issue using this with the latest version of the SDK (3.13.0). Please note that this version includes the below fix:

  • fixed an issue where an "Ads cannot be requested because the ad container is not attached to the view hierarchy." error was fired erroneously.


@Gourav,

Thank you for jumping in. Looking at the thread you shared (which is currently being handled by the team), I really can't tell if this related to this issue since this is a different platform. However, in case you were able to reproduce this issue with our sample applications for iOS, kindly share with us the sample project file for our test reference.

You can send the sample project file to our testing alias: imate...@gmail.com


Regards,

Aaron Bonham

unread,
Jan 24, 2021, 7:36:01 PM1/24/21
to Interactive Media Ads SDK
Hi All,

I am also facing this issue, I can say that it was introduced in IMA version 3.13. We updated from 3.12.1 on 8/11/20 and immediately started seeing this issue.

Fatal Exception: UIViewControllerHierarchyInconsistency
A view can only be associated with at most one view controller at a time! View <IMAWKWebView: 0x126e19f80; frame = (0 0; 812 375); opaque = NO; autoresize = W+H; layer = <CALayer: 0x28065fca0>> is associated with <IMAWebUIViewController: 0x126e136e0>. Clear this association before associating this view with <IMAWebUIViewController: 0x126e1ade0>

It's currently the single largest source of crashes in our app and it would be great to get a resolution.

Kind Regards,
Aaron

IMA SDK

unread,
Jan 25, 2021, 2:10:58 AM1/25/21
to aaron....@sbs.com.au, ima...@googlegroups.com
Hi Aaron,

I work along with Sherwin. Allow me to assist you in this.

Would it be possible for you to provide the following details, for us to investigate the issue further?
  • Sample project where the issue is reproducible
  • Steps to trigger the crash
You can send the sample project file to our testing alias: imate...@gmail.com, then let me know here once the requested information has been sent.

Regards,
Google Logo
Teejay Wennie Pimentel
IMA SDK Team
 


ref:_00D1U1174p._5004Q2B16Lm:ref

manas...@gmail.com

unread,
Apr 9, 2021, 4:22:15 AM4/9/21
to Interactive Media Ads SDK
Hi,

Even I'm facing this crash after updating the GoogleAds-IMA-iOS-SDK  to v3.13.0 in iOS 14.
Crash occurs when mid roll ads play in fullscreen and then when played in PIP.

Terminating app due to uncaught exception 'UIViewControllerHierarchyInconsistency', reason: 'child view controller:<IMAWebUIViewController: 0x7fb4b6d920c0> should have parent view controller:(null) but actual parent is:<IMAAdViewController: 0x7fb4b6d924c0>'

Please can you check this once.

Thanks & regards,

Manasa


IMA SDK

unread,
Apr 9, 2021, 11:25:31 AM4/9/21
to manas...@gmail.com, ima...@googlegroups.com
Hi Manasa,

Thank you for bringing this question to our attention. As stated previously. if you are seeing this issue it generally refers to the face that one of the elements in your app that is maybe calling the SDK is not within the hierarchy of the ViewCotroller. If you believe that everything is within the hierarchy and still getting this error. Can you please share via "Reply to author" button with a simple sample app that reproduces this issue.

Regards,
Google Logo
William Pescherine
Mobile Ads SDK Team
 


ref:_00D1U1174p._5004Q2FX8qt:ref

Jason Tibbetts

unread,
May 4, 2021, 12:49:55 PM5/4/21
to Interactive Media Ads SDK
> one of the elements in your app that is maybe calling the SDK is not within the hierarchy of the ViewCotroller

Can you explain this further? In our case, we have a non-UIView utility class that wraps all of the IMA functionality. The view controller manages this utility and tells it to start the IMA loader and manager. This worked without problems up until Google IMA SDK for iOS 3.12.1.

IMA SDK

unread,
May 4, 2021, 3:11:54 PM5/4/21
to jason.tib...@gmail.com, ima...@googlegroups.com

Hi Jason,

Thank you for the response back with the additional information. First we would ask if you have been able to get this same error when using one of our sample apps, also is it possible to get a sample app. I also see that with 3.13 there should have been a fix for erroneous "Ads cannot be requested because the ad container is not attached to the view hierarchy" errors. Which you can see on our release notes here .

Also if you saw any steps in particular that might be causing this?

Regards,

Google Logo
William Pescherine
IMA SDK Team
 


ref:_00D1U1174p._5004Q2FX8qt:ref
Reply all
Reply to author
Forward
0 new messages