Sdwebimage: SPM: SDWebImage.git could not be resolved

Created on 8 Feb 2020  路  16Comments  路  Source: SDWebImage/SDWebImage

When trying to add the framework via Swift Package Manager I get the error: target 'SDWebImageMapKit' referenced in product 'SDWebImageMapKit' is empty.
Edit: This only happens in Xcode 11.4 beta. I just tried in in Xcode 11.3.1 and it works there. Maybe you want to ignore this issue.

Screenshot 2020-02-08 at 18 39 36

apple bug swiftpm

Most helpful comment

I thought it may be of relevance, but I suppose not.

@dreampiggy I would vote for a standalone repo as you've suggested.

All 16 comments

Please fill the issue template ? At least provide SDWebImage version.

New Issue Checklist

Issue Info

Info | Value |
-------------------------|-------------------------------------|
Platform Name | e.g. ios / macos / tvos / watchos
Platform Version | e.g. 12.0 / 10.14.0 / 12.0 / 5.0
SDWebImage Version | e.g. 5.0.0 / 4.4.0
Integration Method | e.g. carthage / cocoapods / manually
Xcode Version | e.g. Xcode 11 / Xcode 10
Repro rate | e.g. all the time (100%) / sometimes x% / only once
Repro with our demo prj | e.g. does it happen with our demo project?
Demo project link | e.g. link to a demo project that highlights the issue

Issue Description and Steps

Please fill in the detailed description of the issue (full output of any stack trace, compiler error, ...) and the steps to reproduce the issue.

The Package.swift syntax match the official Swift PM standard, which does not use any hacks or tricks. If this does not works, it's Apple's Xcode bug. Currently I can not workaround this.

Maybe we need to fire Radars: https://feedbackassistant.apple.com/

Same issue, I use sub-xcode-project for now. SDWebImage's guide is very clear, thanks.

https://github.com/SDWebImage/SDWebImage/wiki/Installation-Guide#using-sdwebimage-as-sub-xcode-project

Did you fired radar ? If not, I fire one.

If we don't fire radar, maybe Apple's Xcode team does not realize they break SwiftPM's standard and will ship this behavior in official Xcode 11.4.

Fired FB7571208

image

@kylebrowning Hi. Does this proposal have some in-compatbile issue with Swift-5.1 Package.swift behavior ?

I read the poposal, it's about the conditional dependency (Xcode configuration or platform). Does this related to this issue ?

For example, do we need to turn SDWebImageMapKit target, to dependency the Product type of SDWebImage, but not Library type of SDWebImage ?

Another more radical solution. We can move the total MapKit related thing, into a standalone Git Repo.

Just like all what we've done in SDWebImagePhotosPlugin, SDWebImageLinkPlugin, and Coder Plugins.

The MapKit seems not a core feature of SDWebImage, not so many people use that dependency.

I thought it may be of relevance, but I suppose not.

@dreampiggy I would vote for a standalone repo as you've suggested.

@kylebrowning @RyuX51 @maundytime Does Xcode 11.4 Beta 2 solve this issue ?
https://developer.apple.com/documentation/xcode_release_notes/xcode_11_4_beta_2_release_notes?language=objc

If not, maybe it's time to totally move the MapKit integration into another Git Repo. I can do this because this need new Git Repo creation of SDWebImage GitHub organization.

11.4 Beta 2 unfortunately didn't resolve the issue in my tests.

@dreampiggy Unfortunately it doesn't. Still getting target 'SDWebImageMapKit' referenced in product 'SDWebImageMapKit' is empty.

Hi, please have a try with #2947 to see whether this been solved or not.

The #2947 does not fix the problem. The package can now been resolved, however, Xcode 11.4 (works on Xcode 11.3.1) ignore all the source files located in SDWebImage/Core and cause the link error like this:

image

image

This is identical Xcode 11.4's bug, not Swift open source package manager's issue.

See more here:https://forums.swift.org/t/any-changes-to-spm-5-2-with-xcode-11-4-beta2-pure-objective-c-project-which-contains-multiple-targets-now-fail-to-integrate/34101/11

Currently there are no good way to workaround this, one possible way it that we drop to use publicHeadersPath API, but this means we need a file structure change, or create some dummy symbol link file into SDWebImage/SDWebImage/include folder. (See SwiftPM's documentation about this behavior: https://github.com/apple/swift-evolution/blob/master/proposals/0162-package-manager-custom-target-layouts.md, https://forums.swift.org/t/swift-package-manager-for-objc-targets/25968/4)

I think we can wait for Xcode 11.4 official release version to see whether this been fixed ?
@kylebrowning @RyuX51 @maundytime

Seems I found the PR, which alraedy fix this bug:
https://github.com/apple/swift-package-manager/pull/2555

But Xcode 11.4-Beta2 does not released with this changes, wait for Xcode 11.4.0

@kylebrowning @RyuX51 @maundytime

image

I tested that Xcode 11.4-Beta 3 solve this issue. The final release version may not have any issues as well.

Close this issue. For Xcode 11.4-Beta 1/2 user, upgrade to the latest beta version, or the final release version.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

maundytime picture maundytime  路  5Comments

ericeddy picture ericeddy  路  6Comments

ToLengSon picture ToLengSon  路  3Comments

diogot picture diogot  路  4Comments

onato picture onato  路  3Comments