0

In my code I call this code to show admob interstitial:

if (interstitial != nil) {
       if ([interstitial isReady]) {
           auto rootViewController = [UIApplication sharedApplication].keyWindow.rootViewController;
           [interstitial presentFromRootViewController:rootViewController];
           return true;
       }
   }

It works fine in all cases except for one: When user put my app on background and then put it back to foreground - I call this code to display the interstitial. In that case The interstitial ad opens and closes immediately

This is the logs:

2018-06-03 11:31:45.398467+0300 causal-tests-mobile[796:2106332] [LayoutConstraints] Unable to simultaneously satisfy constraints.
    Probably at least one of the constraints in the following list is one you don't want. 
    Try this: 
        (1) look at each constraint and try to figure out which you don't expect; 
        (2) find the code that added the unwanted constraint or constraints and fix it. 
    (Note: If you're seeing NSAutoresizingMaskLayoutConstraints that you don't understand, refer to the documentation for the UIView property translatesAutoresizingMaskIntoConstraints) 
(
    "<NSAutoresizingMaskLayoutConstraint:0x164c41070 h=-&- v=-&- _UIBackdropContentView:0x164bb2c30.midX == _UIBackdropView:0x164bb0f90.midX   (active)>",
    "<NSAutoresizingMaskLayoutConstraint:0x164c77a80 h=-&- v=-&- _UIBackdropContentView:0x164bb2c30.width == _UIBackdropView:0x164bb0f90.width   (active)>",
    "<NSAutoresizingMaskLayoutConstraint:0x164c7a190 h=-&- v=-&- MPVideoContainerView:0x164a922e0.width == MPSwipableView:0x164c02a70.width   (active)>",
    "<NSAutoresizingMaskLayoutConstraint:0x164c7b3f0 h=-&- v=-&- MPSwipableView:0x164c02a70.width == MPMovieView:0x164c18c40.width   (active)>",
    "<NSAutoresizingMaskLayoutConstraint:0x164c7c7e0 h=--& v=--& MPMovieView:0x164c18c40.width == 41   (active)>",
    "<NSAutoresizingMaskLayoutConstraint:0x164c2ff90 h=-&- v=-&- MPVideoPlaybackOverlayView:0x164baf980.width == MPVideoContainerView:0x164a922e0.width   (active)>",
    "<NSLayoutConstraint:0x164c42540 H:|-(34)-[MPKnockoutButton:0x164befd60](LTR)   (active, names: '|':_UIBackdropContentView:0x164bb2c30 )>",
    "<NSLayoutConstraint:0x164c426c0 H:[MPKnockoutButton:0x164befd60]-(34)-[MPDetailSlider:0x164c47880](LTR)   (active)>",
    "<NSLayoutConstraint:0x164c42850 H:[MPDetailSlider:0x164c47880]-(34)-[UIView:0x164bb3d50](LTR)   (active)>",
    "<NSLayoutConstraint:0x164c42340 UIView:0x164bb3d50.right == _UIBackdropView:0x164bb0f90.right - 34   (active)>",
    "<NSLayoutConstraint:0x164c1cc40 MPKnockoutButton:0x164bf03b0.left == UIView:0x164bb3d50.left   (active)>",
    "<NSLayoutConstraint:0x164c1cd50 MPKnockoutButton:0x164bf03b0.right == UIView:0x164bb3d50.right   (active)>",
    "<NSLayoutConstraint:0x164a872a0 H:|-(0)-[_UIBackdropView:0x164bb0f90]   (active, names: '|':MPVideoPlaybackOverlayView:0x164baf980 )>",
    "<NSLayoutConstraint:0x164aef050 H:[_UIBackdropView:0x164bb0f90]-(0)-|   (active, names: '|':MPVideoPlaybackOverlayView:0x164baf980 )>"
)
Will attempt to recover by breaking constraint 
<NSLayoutConstraint:0x164c426c0 H:[MPKnockoutButton:0x164befd60]-(34)-[MPDetailSlider:0x164c47880](LTR)   (active)>

It looks like constraint conflict. But I create my interstitial programmatically and not putting any constraints. Any idea on this?

Innat
  • 16,113
  • 6
  • 53
  • 101
Michael A
  • 5,770
  • 16
  • 75
  • 127

0 Answers0