iOS Crash - PresentViewController

Calling presentViewControllerAnimatedCompletion on the UIViewController instance is crashing the application on iOS 11 with SIGABRT.

I tried the call on iOS 10 and it’s working correctly. However, on iOS 11 it just crashes. There’s no stack trace or some error message. I tried this on iOS 11.0.3 and on iOS 11.1 beta and it’s the same.

Thank you for the report, we will look into this. Are you running MOE 1.4.0?

Best Regards,
Gergely

Hi!

We tried this code with MOE 1.4.0 and ios 11.0.3:

UIAlertController alertController = UIAlertController.alertControllerWithTitleMessagePreferredStyle("Taxi",
                    "Please enable geolocation", UIAlertControllerStyle.Alert);
            UIAlertAction ok = UIAlertAction.actionWithTitleStyleHandler("OK", UIAlertActionStyle.Default, null);
            alertController.addAction(ok);
            this.presentViewControllerAnimatedCompletion(alertController, true, null);

This code worked correctly.

Best Regards,
Roland

My call looks like this. I want to share an image.

UIImage image = getShareImage();
NSMutableArray activityItems = NSMutableArray.alloc().init();
activityItems.add(image);

NSMutableArray<String> excluded = (NSMutableArray<String>) NSMutableArray.alloc().init();
excluded.add(UIKit.UIActivityTypePrint());
excluded.add(UIKit.UIActivityTypeAirDrop());
excluded.add(UIKit.UIActivityTypeAssignToContact());
excluded.add(UIKit.UIActivityTypeCopyToPasteboard());
excluded.add(UIKit.UIActivityTypeSaveToCameraRoll());
excluded.add(UIKit.UIActivityTypeAddToReadingList());

UIActivityViewController avc = UIActivityViewController.alloc();
avc.initWithActivityItemsApplicationActivities(activityItems, null);
avc.setExcludedActivityTypes(excluded);

UIViewController controller = mApplication.getUIViewController();
controller.presentViewControllerAnimatedCompletion(avc, true, null);

It crashes when I call presentViewControllerAnimatedCompletion.
It doesn’t even matter if I put an image or text. Instead of adding an image, I also tried:

activityItems.add("Text to share");

However, on iOS < 11 it works, while on iOS 11 it crashes.

I was using LibGDX 1.9.6 and MOE 1.3.12.
Now I updated to LibGDX 1.9.7 and MOE 1.4.0, but it’s the same.

Hi!

This crash get the device or simulator?
I tried and don’t reproduction this crash.
Test project:
LibgdxMoe1.4.zip (7.4 MB)

Best Regards,
Roland

How can we call a method on press of Okay button in alert or I can say how we can put handle in UIAlertAction.
Thanks in Advance