UIImagePickerController crash on iOS10

Hi everyone.


I develop application and I have strange crash when I try to use photo library. I receive crash and this log message when try to present modally UIImagePickerController:


2016-09-26 18:45:11.876042 AAA[936:62863] [error] error: -addPersistentStoreWithType:SQLite configuration:(null) URL:file:///var/mobile/Media/PhotoData/Photos.sqlite?readonly_shm=1 options:{

NSPersistentStoreFileProtectionKey = NSFileProtectionCompleteUntilFirstUserAuthentication;

NSReadOnlyPersistentStoreOption = 1;

NSSQLitePersistWALOption = 1;

NSSQLitePragmasOption = {

"journal_mode" = WAL;

};

} ... returned error Error Domain=NSCocoaErrorDomain Code=256 "The file couldn’t be opened." UserInfo={reason=Failed to access file: 1} with userInfo dictionary {

reason = "Failed to access file: 1";

}

2016-09-26 18:45:11.876327 AAA[936:62863] [Migration] Unexpected error opening persistent store <private>, cannot attempt migration <private>)

2016-09-26 18:45:11.876605 AAA[936:62863] [Migration] Failed to open store <private>. Requires update via assetsd (256: <private>)

2016-09-26 18:45:11.878019 AAA[936:62863] [error] error: -addPersistentStoreWithType:SQLite configuration:(null) URL:file:///var/mobile/Media/PhotoData/Photos.sqlite?readonly_shm=1 options:{

NSPersistentStoreFileProtectionKey = NSFileProtectionCompleteUntilFirstUserAuthentication;

NSReadOnlyPersistentStoreOption = 1;

NSSQLitePersistWALOption = 1;

NSSQLitePragmasOption = {

"journal_mode" = WAL;

};

} ... returned error Error Domain=NSCocoaErrorDomain Code=256 "The file couldn’t be opened." UserInfo={reason=Failed to access file: 1} with userInfo dictionary {

reason = "Failed to access file: 1";

}

2016-09-26 18:45:11.878170 AAA[936:62863] [Migration] Store open/configuration failed on 2nd attempt: <private>


Can anybody tell me what I can do with this?

I'm having this problem also.


A web view in my app is calling the photo picker. I added the

NSPhotoLibraryUsageDescription
setting in the plist but once I agree to the permissions prompt, the app crashes with this error.

I found the culprit in my particular case. We are using Leanplum for analytics and push notifications. The `Leanplum.syncResourcesAsync` method was causing the opening of the photo library to crash. It took a couple of days to find as I wasn't aware Leanplum was doing anything to hook into a user's photo library... which in itself is concerning.


We weren't using the functionality this particular method brings, so were able to just remove the method call and the photo library stopped crashing.

Are you saying that you are using software that is secretly accessing the photo library without your knowing? If so, what have you done to make other users and Apple aware of this outrageous code?

Hi PBK,


SeanRogs is saying that he is using a 3rd party SDK called Leanplum in his app.

Leanplum is not secretly accessing the photo library. The issue is cause by a method call to Leanplum.syncResourcesAsync() that is done willingly by the developer.

Leanplum is working on a solution and tracking the issue here: https://github.com/Leanplum/Leanplum-iOS-SDK/issues/12


Kind regards

UIImagePickerController crash on iOS10
 
 
Q