ivpusic / react-native-image-crop-picker

iOS/Android image picker with support for camera, video, configurable compression, multiple images and cropping
MIT License
6.11k stars 1.56k forks source link

negative sizes are not supported in the flow layout #1702

Open harleenarora opened 2 years ago

harleenarora commented 2 years ago

Version

Tell us which versions you are using:

Platform

Tell us to which platform this issue is related

Carsh log:: Fatal Exception: NSInternalInconsistencyException negative sizes are not supported in the flow layout

Fatal Exception: NSInternalInconsistencyException 0 CoreFoundation 0x9904c __exceptionPreprocess 1 libobjc.A.dylib 0x15f54 objc_exception_throw 2 Foundation 0x1306cc _userInfoForFileAndLine 3 UIKitCore 0x471bb0 -[UICollectionViewFlowLayout _getSizingInfosWithExistingSizingDictionary:] 4 UIKitCore 0x218634 -[UICollectionViewFlowLayout _fetchItemsInfoForRect:] 5 UIKitCore 0x2100ec -[UICollectionViewFlowLayout prepareLayout] 6 UIKitCore 0x175a3c -[UICollectionViewData _prepareToLoadData] 7 UIKitCore 0x3ecf9c -[UICollectionView _endItemAnimationsWithInvalidationContext:tentativelyForReordering:animator:collectionViewAnimator:] 8 UIKitCore 0x372700 -[UICollectionView _performBatchUpdates:completion:invalidationContext:tentativelyForReordering:animator:animationHandler:] 9 Test project 0x121fe4 __48-[QBAssetsViewController photoLibraryDidChange:]_block_invoke + 410 (QBAssetsViewController.m:410) 10 libdispatch.dylib 0x2914 _dispatch_call_block_and_release 11 libdispatch.dylib 0x4660 _dispatch_client_callout 12 libdispatch.dylib 0x12b60 _dispatch_main_queue_callback_4CF 13 CoreFoundation 0x51cd4 __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ 14 CoreFoundation 0xbeac __CFRunLoopRun 15 CoreFoundation 0x1f3b8 CFRunLoopRunSpecific 16 GraphicsServices 0x138c GSEventRunModal 17 UIKitCore 0x5196a8 -[UIApplication _run] 18 UIKitCore 0x2987f4 UIApplicationMain 19 Test project 0x5900 main + 7 (main.m:7) 20 ??? 0x1040b9a24 (Missing)

React-native Info System: OS: macOS 11.3 CPU: (4) x64 Intel(R) Core(TM) i5-4278U CPU @ 2.60GHz Memory: 30.97 MB / 8.00 GB Shell: 5.8 - /bin/zsh Binaries: Node: 14.15.4 - /usr/local/bin/node Yarn: Not Found npm: 6.14.10 - /usr/local/bin/npm Watchman: Not Found Managers: CocoaPods: 1.10.1 - /usr/local/bin/pod SDKs: iOS SDK: Platforms: iOS 14.5, DriverKit 20.4, macOS 11.3, tvOS 14.5, watchOS 7.4 Android SDK: Not Found IDEs: Android Studio: 4.0 AI-193.6911.18.40.6626763 Xcode: 12.5.1/12E507 - /usr/bin/xcodebuild Languages: Java: Not Found npmPackages: @react-native-community/cli: Not Found react: ^17.0.2 => 17.0.2 react-native: ^0.65.1 => 0.65.1 react-native-macos: Not Found npmGlobalPackages: react-native: Not Found

React-native-navigation:: ^7.20.0

Device Info:: Device Model:iPhone 13 Pro Max Orientation: Face Up RAM free: 1.56 GB Disk free: 64.17 GB Operating System Version:15.1.1 Orientation: Portrait Jailbroken:No Crash

How to fixed crash log.

Sharqiyem commented 2 years ago

the same here.

harleenarora commented 2 years ago

any solution for this crash?

andrei-tofan commented 2 years ago

the same here.

markholland commented 1 year ago

Just had this for the first time.

react-native: 0.69.7 react-native-image-crop-picker: 0.38.1

joshbroton commented 1 year ago

Saw this error in our Crashlytics logs today. react-native 0.71.12 react-native-image-crop-picker 0.39.0

Image selection from the camera roll, no cropping or other editing options.

Any ideas on how to fix?

bqrichards commented 1 year ago

I'm seeing the issue in Crashlytics as well. react-native 0.70.6 react-native-image-crop-picker 0.40.0

iPhone 11 Pro Max on iOS 16.6.0

QBAssetsViewController.m - Line 410
__48-[QBAssetsViewController photoLibraryDidChange:]_block_invoke + 410

Fatal Exception: NSInternalInconsistencyException
Collection view delegate returned a negative size {-inf, -inf} from -collectionView:layout:sizeForItemAtIndexPath: for item 0 in section 0, which is not supported by flow layout. Delegate: <QBAssetsViewController: 0x10a07f000>; collection view: <UICollectionView: 0x115a27600; frame = (0 0; 414 896); clipsToBounds = YES; autoresize = W+H; gestureRecognizers = <NSArray: 0x283138150>; backgroundColor = <UIDynamicSystemColor: 0x282878bc0; name = systemBackgroundColor>; layer = <CALayer: 0x283c8f3a0>; contentOffset: {0, 12469}; contentSize: {414, 13282}; adjustedContentInset: {88, 0, 83, 0}; layout: <UICollectionViewFlowLayout: 0x112db02f0>; dataSource: <QBAssetsViewController: 0x10a07f000>>
marf commented 11 months ago

Same crash

I'm seeing the issue in Crashlytics as well. react-native 0.70.6 react-native-image-crop-picker 0.40.0

iPhone 11 Pro Max on iOS 16.6.0

QBAssetsViewController.m - Line 410
__48-[QBAssetsViewController photoLibraryDidChange:]_block_invoke + 410

Fatal Exception: NSInternalInconsistencyException
Collection view delegate returned a negative size {-inf, -inf} from -collectionView:layout:sizeForItemAtIndexPath: for item 0 in section 0, which is not supported by flow layout. Delegate: <QBAssetsViewController: 0x10a07f000>; collection view: <UICollectionView: 0x115a27600; frame = (0 0; 414 896); clipsToBounds = YES; autoresize = W+H; gestureRecognizers = <NSArray: 0x283138150>; backgroundColor = <UIDynamicSystemColor: 0x282878bc0; name = systemBackgroundColor>; layer = <CALayer: 0x283c8f3a0>; contentOffset: {0, 12469}; contentSize: {414, 13282}; adjustedContentInset: {88, 0, 83, 0}; layout: <UICollectionViewFlowLayout: 0x112db02f0>; dataSource: <QBAssetsViewController: 0x10a07f000>>

Same crash also for us

KarlosQ commented 4 months ago

Same here:

{
"name": "NSInternalInconsistencyException", 
"userInfo":  { 
  "NSAssertLine": 1512,
  "NSAssertFile": "UICollectionViewFlowLayout.m" 
 }
}

Collection view delegate returned a negative size {-inf, -inf} from -collectionView:layout:sizeForItemAtIndexPath: for item 0 in section 0, which is not supported by flow layout. Delegate: <QBAssetsViewController: 0x10a041000>; collection view: <UICollectionView: 0x10785e000; frame = (0 0; 393 852); clipsToBounds = YES; autoresize = W+H; gestureRecognizers = <NSArray: 0x30239a550>; backgroundColor = <UIDynamicSystemColor: 0x30387a9c0; name = systemBackgroundColor>; layer = <CALayer: 0x302d855a0>; contentOffset: {0, 30164.666666666668}; contentSize: {393, 30982.75}; adjustedContentInset: {97.666666666666671, 0, 83, 0}; layout: <UICollectionViewFlowLayout: 0x105432450>; dataSource: <QBAssetsViewController: 0x10a041000>>

RodolfoGS commented 1 month ago

+1