Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

af_setImage withurl throws deleted method error on 'request.resume()' in ImageDownloader.start method #215

Closed
tuxtux59 opened this issue Nov 16, 2016 · 20 comments
Assignees

Comments

@tuxtux59
Copy link

Hi,

I'm running Alamofire 4.1.0 and AlamofireImage 3.1.0 using carthage and swift 3.0.1

I've juste updated to swift 3.0.1 and update carthage alamofires libraries. And all my af_setImage method calls throws deleted method error on 'request.resume()' in ImageDownloader.start method

Code line

I don't know if I can simply delete this line or need I to use other method instead of af_setImage?

Is it a new version, a rapid fix or something I can do while waiting for next release to continue using alamofireImage for getting images from web?

Thanks by advance

@hdoria
Copy link

hdoria commented Nov 16, 2016

Same here.

@tuxtux59
Copy link
Author

Same for you or same in other issue?

@hdoria
Copy link

hdoria commented Nov 16, 2016

Same for me, sorry.

@jndonald3
Copy link

I'm seeing this as well. It doesn't seem like that location itself should cause a crash, but I haven't been able to find any other sources.

The error log simply says "fatal error: call of deleted method"
Here's the crash log from our app:

Crashed: org.alamofire.imagedownloader.synchronizationqueue-0018251aed6b0a40
0  libsystem_kernel.dylib         0x1146dbf06 __pthread_kill + 10
1  libsystem_pthread.dylib        0x1146a34ec pthread_kill + 90
2  libsystem_c.dylib              0x11444aa44 abort + 129
3  libswiftCore.dylib             0x11123a315 swift::fatalError(unsigned int, char const*, ...) + 149
4  libswiftCore.dylib             0x11123a334 swift_deletedMethodError + 20
5  AlamofireImage                 0x10e5a5a61 specialized ImageDownloader.(download(URLRequestConvertible, receiptID : String, filter : ImageFilter?, progress : (Progress) -> ()?, progressQueue : DispatchQueue, completion : (DataResponse<UIImage>) -> ()?) -> RequestReceipt?).(closure #1) (ImageDownloader.swift:516)
6  AlamofireImage                 0x10e59b15d ImageDownloader.(download(URLRequestConvertible, receiptID : String, filter : ImageFilter?, progress : (Progress) -> ()?, progressQueue : DispatchQueue, completion : (DataResponse<UIImage>) -> ()?) -> RequestReceipt?).(closure #1) (ImageDownloader.swift)
7  AlamofireImage                 0x10e5a2861 partial apply for ImageDownloader.(download(URLRequestConvertible, receiptID : String, filter : ImageFilter?, progress : (Progress) -> ()?, progressQueue : DispatchQueue, completion : (DataResponse<UIImage>) -> ()?) -> RequestReceipt?).(closure #1) (ImageDownloader.swift)
8  libdispatch.dylib              0x1143744a7 _dispatch_client_callout + 8
9  libdispatch.dylib              0x11435cfd0 _dispatch_barrier_sync_f_invoke + 99
10 AlamofireImage                 0x10e5a25b0 specialized ImageDownloader.download(URLRequestConvertible, receiptID : String, filter : ImageFilter?, progress : (Progress) -> ()?, progressQueue : DispatchQueue, completion : (DataResponse<UIImage>) -> ()?) -> RequestReceipt? (ImageDownloader.swift)
11 AlamofireImage                 0x10e5bb40a UIImageView.af_setImage(withURLRequest : URLRequestConvertible, placeholderImage : UIImage?, filter : ImageFilter?, progress : (Progress) -> ()?, progressQueue : DispatchQueue, imageTransition : UIImageView.ImageTransition, runImageTransitionIfCached : Bool, completion : (DataResponse<UIImage>) -> ()?) -> () (ImageDownloader.swift)
12 AlamofireImage                 0x10e5ba7dd UIImageView.af_setImage(withURL : URL, placeholderImage : UIImage?, filter : ImageFilter?, progress : (Progress) -> ()?, progressQueue : DispatchQueue, imageTransition : UIImageView.ImageTransition, runImageTransitionIfCached : Bool, completion : (DataResponse<UIImage>) -> ()?) -> () (UIImageView+AlamofireImage.swift:222)
13 Forge                          0x10e02cc4d specialized UIImageView.image(usingURL : URL?, andPlaceHolder : UIImage?) -> () (UIImageView+Forge.swift)
14 Forge                          0x10e02c6a9 @objc UIImageView.image(usingURL : URL?, andPlaceHolder : UIImage?) -> () (UIImageView+Forge.swift)
15 Forge                          0x10dfc2537 CalendarCell.setup(withObject : Shift?) -> () (CalendarCell.swift)
16 Forge                          0x10e0239e3 specialized specialized FeatureListVC.tableView(UITableView, willDisplay : UITableViewCell, forRowAt : IndexPath) -> () (FeatureListVC.swift)
17 Forge                          0x10e029209 specialized CalendarVC.tableView(UITableView, willDisplay : UITableViewCell, forRowAt : IndexPath) -> () (CalendarVC.swift)
18 Forge                          0x10e026240 @objc CalendarVC.tableView(UITableView, willDisplay : UITableViewCell, forRowAt : IndexPath) -> () (CalendarVC.swift)
19 UIKit                          0x10fcad739 -[UITableView _createPreparedCellForGlobalRow:withIndexPath:willDisplay:] + 916
20 UIKit                          0x10fcad7c8 -[UITableView _createPreparedCellForGlobalRow:willDisplay:] + 74
21 UIKit                          0x10fc83650 -[UITableView _updateVisibleCellsNow:isRecursive:] + 3187
22 UIKit                          0x10fcb6595 -[UITableView _performWithCachedTraitCollection:] + 92
23 UIKit                          0x10fc9e9ad -[UITableView layoutSubviews] + 218
24 UIKit                          0x10fc0f11c -[UIView(CALayerDelegate) layoutSublayersOfLayer:] + 710
25 QuartzCore                     0x117db036a -[CALayer layoutSublayers] + 146
26 QuartzCore                     0x117da4bd0 CA::Layer::layout_if_needed(CA::Transaction*) + 366
27 QuartzCore                     0x117da4a4e CA::Layer::layout_and_display_if_needed(CA::Transaction*) + 24
28 QuartzCore                     0x117d991d5 CA::Context::commit_transaction(CA::Transaction*) + 277
29 QuartzCore                     0x117dc69f0 CA::Transaction::commit() + 508
30 QuartzCore                     0x117dc7154 CA::Transaction::observer_callback(__CFRunLoopObserver*, unsigned long, void*) + 92
31 CoreFoundation                 0x10f5999d7 __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 23
32 CoreFoundation                 0x10f599947 __CFRunLoopDoObservers + 391
33 CoreFoundation                 0x10f58f59b __CFRunLoopRun + 1147
34 CoreFoundation                 0x10f58ee98 CFRunLoopRunSpecific + 488
35 GraphicsServices               0x117c78ad2 GSEventRunModal + 161
36 UIKit                          0x10fb5e676 UIApplicationMain + 171
37 Forge                          0x10dfb15d3 main (AppDelegate.swift:22)
38 libdyld.dylib                  0x1143a392d start + 1

@efremidze
Copy link

efremidze commented Nov 16, 2016

Same, this is only happening after updating to Alamofire 4.1.0.
Alamofire 4.0.1 doesn't have this issue.

@dasmer
Copy link

dasmer commented Nov 17, 2016

same here

@victorrr
Copy link

Same here. @efremidze I am still getting the error with Alamofire 4.0.1
github "Alamofire/Alamofire" == 4.0.1
github "Alamofire/AlamofireImage" ~> 3.0

@gautier-gdx
Copy link

same here

@treyrich
Copy link

+1

@jasonnam
Copy link

+1!!!

@cnoon
Copy link
Member

cnoon commented Nov 20, 2016

I'd say you all need to probably clean and build again based on everything I've found when googling around:

I've been unable to reproduce this issue with our sample app. If someone can put up a sample app that reproduces this issue, I'll be happy to investigate further. But it looks like right now it's most likely a project configuration issue. As always, first clean and rebuild. If the issue persists, then wipe DerivedData and try again.

I'm going to close this issue out for now. If someone can submit a sample app that repros the problem, I'll be more than happy to re-open this issue and investigate further.

Cheers. 🍻

@cnoon cnoon closed this as completed Nov 20, 2016
@cnoon cnoon added the support label Nov 20, 2016
@cnoon cnoon self-assigned this Nov 20, 2016
@JonFir
Copy link

JonFir commented Nov 20, 2016

As always, first clean and rebuild. If the issue persists, then wipe DerivedData and try again.

not work for me(((

@tholo
Copy link

tholo commented Nov 20, 2016

I hate to say this, but ... I got this happening with a project of mine too. On a brand new MacBook Pro that had no pre-existing DerivedData (fresh install), using Carthage for Alamofire (4.1.0) & AlamofireImage (3.1.0).

Fresh Xcode via App Store, fresh Carthage pkg from GitHub, build from clean checkout of own source code. Run in simulator. Load image via af_setImage. Poof.

@Kievkao
Copy link

Kievkao commented Nov 20, 2016

The same issue

@cnoon
Copy link
Member

cnoon commented Nov 20, 2016

Fair enough everyone. So who can submit a sample project that demonstrates the issue? @tholo? @Kievkao? @JonFir? I was unable to repro in the sample app.

@jndonald3
Copy link

@cnoon I've created a very simple example in which I was able to reproduce the issue. See here:
https://github.com/joinforge/AlamofireImageSample

Let me know if you have any issues with the project

@cnoon
Copy link
Member

cnoon commented Nov 21, 2016

Awesome, thank you @jndonald3. I'll dig in and see what I can find. 🍻

@cnoon
Copy link
Member

cnoon commented Nov 21, 2016

Is the issue Carthage? Has anyone reproduced this with CocoaPods or submodules? I was unable to repro it last night with the AFI sample app.

@cnoon
Copy link
Member

cnoon commented Nov 21, 2016

Okay everyone, @jshier and I have mostly gotten to the bottom of the issue. It looks to be a weird issue with Carthage. The sample app definitely produces the error you all are seeing when using Carthage. Thanks again @jndonald3! 🍻

I was able to get the sample app working with CocoaPods and pure submodules without issue. I was also able to get the sample app working by simply pointing at the master branches for both AF and AFI. So that's good news! Most likely the issue will be resolved as soon as we cut the AF and AFI releases here shortly.

We checked all the project settings in AF and AFI and they're all correct. It seems to be some optimization or project setting mismatch here. What we think the underlying issue is is that the Cartfile specifies AF 4.1+ and AFI 3.1+. The AFI 3.1.0 release points to the AF 4.0.1 submodule. It appears that when Carthage compiles the AFI framework, it's actually compiling against the AF 4.0.1 release and not the 4.1.0 which it previously built. This could be due to the AF project being nested directly inside the AFI project rather than using weak linking through a workspace. We had to do this quite a while ago since xcodebuild was randomly pulling the AF watchOS framework as a dependency for the AFI iOS framework. Long story short, the workspace weak linking didn't work for us across all platforms, so we had to revert to direct nesting inside the AFI project.

What's really odd is that we've had the project structured this way for at least a year and we've never seen this issue. We're guessing this is some sort of regression on the Carthage side. If there's some odd issue with the AF or AFI project configuration, we have no idea what it is. If someone wants to open up an issue with the Carthage team to have them investigate further, that would probably be wise. They should be able to figure out what the problem is with @jndonald3's sample app.

So in summary, the issue is Carthage. Thankfully though, Carthage appears to work when we update the AF submodule in AFI to match the latest version of AF. So once we release the latest releases here shortly, they should work for now. That doesn't mean this won't break again though with the next Alamofire release after that.

Would someone be willing to open a ticket with the Carthage team to continue this investigation?

I'm going to close this issue out since there's nothing left for us to investigate. Please feel free to link this ticket to the Carthage ticket for more info.

Cheers. 🍻

@gautier-gdx
Copy link

It's working again with 3.2.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests