Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

App Crashes on iOS 17.2.1 After Taking a Photo #42

Open
Mustafa7Ibrahim opened this issue Jan 3, 2024 · 13 comments
Open

App Crashes on iOS 17.2.1 After Taking a Photo #42

Mustafa7Ibrahim opened this issue Jan 3, 2024 · 13 comments
Assignees

Comments

@Mustafa7Ibrahim
Copy link

Description:

After updating to iOS version 17.2.1, users are experiencing crashes in the app when attempting to take a photo. This issue was not present in previous iOS versions.

Steps to Reproduce:

  1. Update the device to iOS 17.2.1.
  2. Open the app.
  3. Attempt to take a photo.

Note:

Please prioritize investigating and addressing this issue as it significantly impacts user experience on the latest iOS release. Thank you!

@monstar-harsh
Copy link

Faced same issue in ios 17.2.1

@urshofer
Copy link

urshofer commented Jan 6, 2024

Got the same issue, but only in debug mode. Implementing VNDocumentCameraViewController is also problematic with other frameworks (like capacitor/ionic). A lot of crashes due to memory pressure...

@vicajilau
Copy link
Collaborator

vicajilau commented Jan 9, 2024

I am facing this issue, but on my iPhone 15 Pro on version 17.2.1 I am not being able to reproduce the crash. Could any of you provide me more information? On the other hand, could you review if you have the same issue (crash) with the example project of this repository? Thanks a lot

@urshofer
Copy link

It's a tricky one. It looks like the crashes are device dependent. Super rare on my iPad Mini (5th gen) / more regular on my iPhone SE (2020). After updating to 17.2.1 my app also crashes on other occasions when memory intensive things happen (i.e loading a large Image). Will provide crash logs later.

@ShubhalaxmiSarwate
Copy link

I am also facing the same issue in iOS 17.2.1 in debug mode. I also added .lldbinit file to increase the timeout. But still the app crashes.

@vicajilau
Copy link
Collaborator

vicajilau commented Jan 14, 2024

Can any of you confirm that you are adding in the Info.Plist file the entry NSCameraUsageDescription and that in the Podfile you are entering the following?

image

@vicajilau vicajilau self-assigned this Jan 14, 2024
@ShubhalaxmiSarwate
Copy link

@vicajilau I have both the entries. Everything was working fine earlier. But after the iOS upgrade, the app crashes when i try to scan a dcument.

@urshofer
Copy link

I can confirm that my permission settings are correct. The crash happens only in debug mode and seems to be device dependent (see #42 (comment)). I guess it is a memory issue, since i have Jetsam events on my phone which lead me to assume that the app is killed due to memory pressure.
Not sure to get more detailed information; XCode is very quiet (just mentioning ...lost connection...).

@urshofer
Copy link

If a crash happens I guess there's nothing we can do about it. It's a problem with VNDocumentCameraViewController itself creating a spike in memory usage that kills the application. I made a test implementation in Objective C (to make sure it's not a swift issue), just opening the scanner view on startup. The crash happens at the exact same moment (after auto capture the first image or manually hitting the capture button).

This is the very basic objective c implementation:

#import "FlutterDocumentScannerPlugin.h"
#import <VisionKit/VisionKit.h>

@implementation FlutterDocumentScannerPlugin
+ (void)registerWithRegistrar:(NSObject<FlutterPluginRegistrar>*)registrar {
  FlutterMethodChannel* channel = [FlutterMethodChannel
      methodChannelWithName:@"flutter_document_scanner"
            binaryMessenger:[registrar messenger]];
  FlutterDocumentScannerPlugin* instance = [[FlutterDocumentScannerPlugin alloc] init];
  [registrar addMethodCallDelegate:instance channel:channel];
}

- (void)handleMethodCall:(FlutterMethodCall*)call result:(FlutterResult)result {
  if ([@"openDocumentScanner" isEqualToString:call.method]) {
      UIViewController *viewController = UIApplication.sharedApplication.keyWindow.rootViewController;
      VNDocumentCameraViewController *scannerViewController = [[VNDocumentCameraViewController alloc] init];
      scannerViewController.delegate = self;
      [viewController presentViewController:scannerViewController animated:YES completion:nil];
      result(nil);
  }
  else {
    result(FlutterMethodNotImplemented);
  }
}

@end

As already mentioned: The crash is device dependent, more or less regular, mostly in debug mode, but probably also in production. The only way would be a complete different scanner library. Any hints?

@Remigius2011
Copy link

did anybody try to capture / evaluate crash reports of his/her app?

@jachzen
Copy link
Owner

jachzen commented Mar 6, 2024

Thnaks for all your investigation. Crash reports of productive apps would be indeed nice to see how many user affects this issue. What about later iOS versions? 17.3 / 17.4 same issue?

@urshofer
Copy link

urshofer commented Mar 7, 2024

In my case the app crashes without any log output. It's being killed by the system. I migrated to WeScan to avoid the built in iOS scanner. It's less sophisticated but looks more stable...

@namchenie
Copy link

My app crashes right after I scan the first photo, everytime on Iphone SE with IOS version 17.3.1, happen in production. But on Iphone 11 it works without crashing. Here is the log I get when the app crash:

IOSurface creation failed: e00002bd parentID: 00000000 properties: {
IOSurfaceAllocateFromSuperbuffer = 0;
IOSurfaceBytesPerElement = 8;
IOSurfaceBytesPerRow = 27136;
IOSurfaceCacheMode = 0;
IOSurfaceHeight = 2240;
IOSurfaceName = CoreImage;
IOSurfacePixelFormat = 1380411457;
IOSurfaceProtectionOptions = 0;
IOSurfaceWidth = 3392;
}
Failed to allocate IOSurface (3392x2240 format:RGhA)
Cache Stats: count=65 size=253MB non-volatile=226MB peakCount=125 peakSize=285MB peakNVSize=228MB

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants