App crashed in VNDocumentCameraViewController(iOS 13 beta)

I used VNDocumentCameraViewController for scanning a document.Whenever open a scanned images and then click the 'Done' button ,application got crashed.
Crash log:

*** Assertion failure in -[UIApplication _createStatusBarWithRequestedStyle:orientation:hidden:], /BuildRoot/Library/Caches/com.apple.xbs/Sources/UIKitCore/UIKit-3898.7/UIApplication.m:5237

2019-07-19 18:05:41.369581+0530 Doc-Scan Swift[398:76718] *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'App called -statusBar or -statusBarWindow on UIApplication: this code must be changed as there's no longer a status bar or status bar window. Use the statusBarManager object on the window scene instead.'

Replies

Same issue here - no idea what's wrong, since I'm testing it in a blank new project. Probably a bug in VisionKit.
Strange to see the same thing works in Notes.

Same in iOS 13 production.


1. Take a scan

2. Tap on thumbnail

3. Choose "Black & White"

4. Press "Retake"


Crashes in my app https://apps.apple.com/us/app/onepile/id1437495207


Does not crash in Notes app


Here is an ugly workaround:


#import 
#import "AppDelegate.h"

@interface Application : UIApplication
@end

@implementation Application

- (id)statusBar {
    return nil;
}

@end

int main(int argc, char * argv[]) {
    @autoreleasepool {
        if (@available(iOS 13, *)) {
            return UIApplicationMain(argc, argv, NSStringFromClass([Application class]), NSStringFromClass([AppDelegate class]));
        } else {
            return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class]));
        }
    }
}

Even I am facing the same issue, I also did a basic sample app and it crashes even in the sample app.

Hi,

I have encountered the same problem when useVNDocumentCameraViewController. 😐

Have you solved it?

Update! Just update my iPhone to iOS 13.1 version, the crash disappear!

Very stange.

But in this scan view controller, the UI looks not good, has some misplace and localized problem.

This bug returned !

App crashes when click keep scan button while device debug.

If I select Black & White app doesn't crash I can still scan docs.

Also If I run app without debug it works perfect

iOS : 17.2

Xcode : 15.1