Home Features Docs Blog Support GitHub

iOS Crash - PresentViewController


(Amy Zoberman) #1

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.


(Gergely Kis - Migeran) #2

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

Best Regards,
Gergely


(Roland Vigh - Migeran) #3

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


(Amy Zoberman) #4

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.


(Roland Vigh - Migeran) #5

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