Skip to content

XCTests and XCUITests failing on image_picker package iOS 17 XCode RC1 #134973

@rzambroni

Description

@rzambroni

Is there an existing issue for this?

Steps to reproduce

Install XCode RC1 and iOS 17.0 Simulator

git clone GitHub - flutter/packages: A collection of useful packages maintained by the Flutter team

cd packages

cd image_picker/image_picker_ios/example/ios

flutter pub get

pod install

Run the test using command (Replace $simulator_id):

xcodebuild test -workspace Runner.xcworkspace -scheme Runner \

-destination 'platform=iOS Simulator,id=$simulator_id' > logs.txt

9- Alternatively, you can run test inside Xcode in the Test Navigator

Expected results

Running all tests should succeed

Actual results

image

[Screenshot 1]: Xcode test navigator showing crashing on tests.

image

[Screenshot 2]: [testSaveICOImage, testSaveSVGImage] failing (crashing).

Code sample

Code sample
[Paste your code here]

Screenshots or Video

Screenshots / Video demonstration

[Upload media here]

Logs

Logs
Test Suite 'Selected tests' started at 2023-09-18 16:20:23.424.

Test Suite 'RunnerTests.xctest' started at 2023-09-18 16:20:23.426.

Test Suite 'PickerSaveImageToPathOperationTests' started at 2023-09-18 16:20:23.426.

Test Case '-[PickerSaveImageToPathOperationTests testSaveICOImage]' started.

2023-09-18 16:20:23.622930-0300 Runner[20299:189771] *** Assertion failure in void _UIGraphicsBeginImageContextWithOptions(CGSize, BOOL, CGFloat, BOOL)(), UIGraphics.m:410

2023-09-18 16:20:23.639739-0300 Runner[20299:189771] *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'UIGraphicsBeginImageContext() failed to allocate CGBitampContext: size={0, 0}, scale=1.000000, bitmapInfo=0x2002. Use UIGraphicsImageRenderer to avoid this assert.'

*** First throw call stack:

(

0   CoreFoundation                      0x000000010b66128d __exceptionPreprocess + 242

1   libobjc.A.dylib                     0x0000000107b76894 objc_exception_throw + 48

2   Foundation                          0x0000000108353e27 -[NSMutableDictionary(NSMutableDictionary) classForCoder] + 0

3   UIKitCore                           0x000000011b98a320 _UIGraphicsBeginImageContextWithOptions + 702

4   Runner                              0x0000000107521db4 +[FLTImagePickerImageUtil scaledImage:maxWidth:maxHeight:isMetadataAvailable:] + 1764

5   Runner                              0x0000000107529ad7 -[FLTPHPickerSaveImageToPathOperation processImage:] + 535

6   Runner                              0x00000001075297e6 __44-[FLTP

*** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'UIGraphicsBeginImageContext() failed to allocate CGBitampContext: size={0, 0}, scale=1.000000, bitmapInfo=0x2002. Use UIGraphicsImageRenderer to avoid this assert.'

*** First throw call stack:

(

0   CoreFoundation                      0x000000010b66128d __exceptionPreprocess + 242

1   libobjc.A.dylib                     0x0000000107b76894 objc_exception_throw + 48

2   Foundation                          0x0000000108353e27 -[NSMutableDictionary(NSMutableDictionary) classForCoder] + 0

3   UIKitCore                           0x000000011b98a320 _UIGraphicsBeginImageContextWithOptions + 702

4   Runner                              0x0000000107521db4 +[FLTImagePickerImageUtil scaledImage:maxWidth:maxHeight:isMetadataAvailable:] + 1764

5   Runner                              0x0000000107529ad7 -[FLTPHPickerSaveImageToPathOperation processImage:] + 535

6   Runner                              0x00000001075297e6 __44-[FLTPHPickerSaveImageToPathOperation start]_block_invoke + 102

7   Foundation                          0x0000000108417219 __76-[NSItemProvider loadDataRepresentationForTypeIdentifier:completionHandler:]_block_invoke_3 + 203

8   libdispatch.dylib                   0x0000000115ceca90 _dispatch_call_block_and_release + 12

9   libdispatch.dylib                   0x0000000115cedd3a _dispatch_client_callout + 8

10  libdispatch.dylib                   0x0000000115cf585c _dispatch_lane_serial_drain + 1236

11  libdispatch.dylib                   0x0000000115cf63f7 _dispatch_lane_invoke + 406

12  libdispatch.dylib                   0x0000000115d01fac _dispatch_root_queue_drain_deferred_wlh + 276

13  libdispatch.dylib                   0x0000000115d01572 _dispatch_workloop_worker_thread + 552

14  libsystem_pthread.dylib             0x00000001163dbc55 _pthread_wqthread + 327

15  libsystem_pthread.dylib             0x00000001163dabbf start_wqthread + 15

)

libc++abi: terminating due to uncaught exception of type NSException

Flutter Doctor output

Doctor output
[✓] Flutter (Channel master, 3.14.0-14.0.pre.333, on macOS 13.5.2 22G91 darwin-x64, locale en-UY)

[✓] Xcode - develop for iOS and macOS (Xcode 15.0)

[✓] Chrome - develop for the web

[✓] VS Code (version 1.82.2)

[✓] Connected device (3 available)

[✓] Network resources

Metadata

Metadata

Labels

P2Important issues not at the top of the work listfrom: manual-qaIssue caught from manual QA processplatform-iosiOS applications specificallyteam-iosOwned by iOS platform teamtriaged-iosTriaged by iOS platform team

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions