YPImagePicker is getting crashed while initialise the config file

Created on 21 Aug 2018  路  17Comments  路  Source: Yummypets/YPImagePicker

Bug Crash

Most helpful comment

var config = YPImagePickerConfiguration()
config.onlySquareImagesFromCamera = true
let picker = YPImagePicker(configuration: config)

If I print the config in the console, the below error is showing to me and after that app is crashed.

po config
error: Execution was interrupted, reason: EXC_BAD_ACCESS (code=1, address=0x1).
The process has been returned to the state before expression evaluation.

All 17 comments

var config = YPImagePickerConfiguration()
config.onlySquareImagesFromCamera = true
let picker = YPImagePicker(configuration: config)

If I print the config in the console, the below error is showing to me and after that app is crashed.

po config
error: Execution was interrupted, reason: EXC_BAD_ACCESS (code=1, address=0x1).
The process has been returned to the state before expression evaluation.

I have tha same issue with Cordova ios@~4.5.5 Plugin
I use like that:

func getPictures(_ command: CDVInvokedUrlCommand) {
    var config = YPImagePickerConfiguration()
    config.library.mediaType = .photo
    let picker = YPImagePicker(configuration: config) // Thread 1: EXC_BAD_ACCESS (code=EXC_I386_GPFLT)

    viewController.present(picker, animated: true, completion: nil)
}

I have enabled Zomby objects in XCode 9 but it doesn't help.

Maybe somebody has any ideas what is wrong?

same issue here

Same issue with 3.4.0

Edit: fixed by migrating project to Swift 4.1

Try 3.4.1 in master branch.

I have updated YPimagePicker to 3.4.1, still getting crash on

let picker = YPImagePicker(configuration: config)

yes, it's the same

@MandeepSingh1
Could you please fill the info below so that we can try to reproduce on our end?

Environment (please complete the following information):

  • Device: [e.g. iPhone6]
  • OS: [e.g. iOS8.1]
  • Xcode Version [e.g. 9.4.1]
  • Swift Version [e.g. 4.1]

Installation Type

  • Carthage
  • Cocoapods
  • Manual

@zipme @Neelu1112 @dan-leech If you could provide a sample project reproducing the crash that would help us tremendously 馃檹

Hi @s4cha,

As mentioned by @Dranix, the issue seems to be resolved by updating the core project Swift Language Version from 3.3 to 4.1.

I have attached a sample project where the issue is reproducible. Please read the README file within the project to see how I was able to recreate the issue in the sample project.

Environment:

Devices:
Simulator - iPhone 8 Plus
Simulator - iPhone X
iPhone 7 Plus (Physical Device on iOS 11.2.6)
OS: iOS 11
Xcode Version 9.4.1
Swift Version: 3.3

Installation Type:

Cocoapods

SampleProject.zip

when this issue will get resolved. I need this urgent basis. @s4cha

Hi @s4cha,

As mentioned by @Dranix, the issue seems to be resolved by updating the core project Swift Language Version from 3.3 to 4.1.

I have attached a sample project where the issue is reproducible. Please read the README file within the project to see how I was able to recreate the issue in the sample project.

Environment:

Devices:
Simulator - iPhone 8 Plus
Simulator - iPhone X
iPhone 7 Plus (Physical Device on iOS 11.2.6)
OS: iOS 11
Xcode Version 9.4.1
Swift Version: 3.3

Installation Type:

Cocoapods

SampleProject.zip

the same issue I'm facing

@erickasnetsis Thanks a ton for the example project, this is really appreciated 馃檹

Indeed the issue lies in the fact that your projects are in swift 3 and Cocoapods pulls a version of the YPImagePicker that is written in swift 4.

Somehow 1.2.1 hasn't a pod version, so you can target swift 3 with 1.2.0
https://github.com/Yummypets/YPImagePicker/releases/tag/1.2.0

target 'SampleProject'
pod 'YPImagePicker', '1.2.0'
use_frameworks!

Old Readme: https://github.com/Yummypets/YPImagePicker/tree/1.2.0

This is related to https://github.com/Yummypets/YPImagePicker/issues/229. by the way.

@Neelu1112, @MandeepSingh1, @zipme, @dan-leech
鈿狅笍 Please be aware that 29 releases have been out since 1.2.0 so I would strongly encourage you to migrate to swift 4. This will include many features and bugfixes.

Hope this helps,

@s4cha I migrate my project to swift 4, it is working as expected.
thanks.

@MandeepSingh1 Any news on this?

var config = YPImagePickerConfiguration()
config.screens = [.library, .photo, .video]
config.targetImageSize = .original
config.library.mediaType = YPlibraryMediaType.photo
config.usesFrontCamera = false
config.showsFilters = true

    // Build a picker with your configuration
    let picker = YPImagePicker(configuration: config)

it still crashing on the let picker line. I am using swift 4.
pod "YPImagePicker" 3.4.1 version
pod "PryntTrimmerView" 2.0 version

Anyone can help me?

Closing for lack of activity, feel free to reopen if needed :)

I'm getting the same crash on version 4.2.0 on iPhone Xs Max, iOS 13.5

Was this page helpful?
0 / 5 - 0 ratings

Related issues

VitaliiDeveloper picture VitaliiDeveloper  路  5Comments

Berk-Kaya picture Berk-Kaya  路  3Comments

DamascenoRafael picture DamascenoRafael  路  5Comments

roarapps picture roarapps  路  4Comments

uxight picture uxight  路  6Comments