Kjuly / ALAssetsLibrary-CustomPhotoAlbum

A nice ALAssetsLibrary category for saving images & videos into custom photo album.
http://www.touch-code-magazine.com/ios5-saving-photos-in-custom-photo-album-category-for-download/
MIT License
405 stars 101 forks source link

Not working on iOS8 #16

Closed sarperdag closed 9 years ago

sarperdag commented 10 years ago

Getting this error on iOS8

Error Domain=LIB_ALAssetsLibrary_CustomPhotoAlbum Code=0 "ALAssetsGroup failed to add asset: ALAsset - Type:Photo, URLs:assets-library://asset/asset.PNG?id=34FFE0D1-08BB-45DA-9C91-50D96F6158B9&ext=PNG." UserInfo=0x17927cec0 {NSLocalizedDescription=ALAssetsGroup failed to add asset: ALAsset - Type:Photo, URLs:assets-library://asset/asset.PNG?id=34FFE0D1-08BB-45DA-9C91-50D96F6158B9&ext=PNG.}

Kjuly commented 10 years ago

Thx for ur report, will try to fix it when i've got time :)

jasoncox commented 10 years ago

Looks like this happens when previously an album with the specified name has been deleted.

sarperdag commented 10 years ago

that's right

jasoncox commented 10 years ago

I'll have some time to check it out on Sunday.

Kjuly commented 9 years ago

"Looks like this happens when previously an album with the specified name has been deleted"

Hm... seems not, I tried but without any crash (iPhone 5 with iOS 8.0). Just got the issue #15 "Can not create album with name similar to deleted album" (I will try to fix it).

Generally, the image token via camera is JPG type, as the error shows it's PNG type, so @sarperdag , u tried to add the image from Photo Library, right? Can u offer some related testing code? That'll be helpful to reproduce this bug. Thx :)

jasoncox commented 9 years ago

@Kjuly for me this was on a 4s, I've got some time now so I will look into it and let you know.

Kjuly commented 9 years ago

Thx @jasoncox, and for the issue related to delete custom album, it seems SDK's bug. I've left a comment below issue #15 .

Kjuly commented 9 years ago

Issue was fixed by PR https://github.com/Kjuly/ALAssetsLibrary-CustomPhotoAlbum/pull/19

renjithn commented 9 years ago

Error Domain=LIB_ALAssetsLibrary_CustomPhotoAlbum Code=0 "ALAssetsGroup failed to add asset: (null)." UserInfo=0x1638c9b0 {NSLocalizedDescription=ALAssetsGroup failed to add asset: (null).}

The same error also happens when there is not enough space in the device.

Kjuly commented 9 years ago

@renjithn interesting case, but i notice the asset u tried to add is null.

renjithn commented 9 years ago

Yes interesting. On debugging I see that writeVideoAtPathToSavedPhotosAlbum: completion handler is invoked with assetURL = nil and also error = nil.

As a result [self addAssetURL:assetURL toAlbum:albumName completion:completion failure:failure]; gets called with a nil assetURL and hence the error.

johntaiii commented 9 years ago

u u3l9aclt8r 5s2g q

failed to add asset on iOS 8.1.2

Kjuly commented 9 years ago

@johntaiii latest version? have u imported the Photos.framework?

MMasterson commented 9 years ago

ALAssetsGroup failed to add asset: (null)." UserInfo=0x175a64e40 {NSLocalizedDescription=ALAssetsGroup failed to add asset: (null)

iOS 8.4 - I am not passing null...

Kjuly commented 9 years ago

@MMasterson when did u invoke the saving logic? I think the resource might not be prepared/generated before u try to save it. B.t.w., can u open a new issue w/ some sample code that u used? Thx :)

mrugeshtank commented 6 years ago

I'm getting same issue Here is my code [library saveVideo:self.video toAlbum:albumName completion:completion failure:failure]; here library, self.video, albumName, completion and failure are not null checked that. Still getting error here is error log.

Error Domain=LIB_ALAssetsLibrary_CustomPhotoAlbum Code=0 "ALAssetsGroup failed to add asset: (null)." UserInfo={NSLocalizedDescription=ALAssetsGroup failed to add asset: (null).}

Here are some other info. Lib version via CocoaPod: 1.3.4 iOS version: 11.4.1 Device: iPhone 6

Kjuly commented 6 years ago

Hi @mrugeshtank , can u provide a sample project (u can host in a temp repo) that can reproduce ur case? Thanks in advance.

And btw, i'd suggest u use Photos.framework instead, even i don't use ALAssetsLibrary now. 😅