1

I have been trying to add Swift Package dependency ("wireguard") in my xcode project but it shows the error that ld: Library not found

I have added it locally with URL path like path///user/Desktop/xyz and from GitHub as well but it shows the same error. I have tried many solution from stack overflow and many other platforms but nothing works.

Please guide me how to add SPM locally in my project My xcode version is 12.3. PS I have access to apple developer account and my local package is working fine no errors their.

  • 1
    https://developer.apple.com/documentation/xcode/creating_a_standalone_swift_package_with_xcode https://developer.apple.com/documentation/swift_packages/organizing_your_code_with_local_packages – Joakim Danielson Feb 08 '21 at 13:23

2 Answers2

1

This is a minor point but important one with drag & drop. When you drag the folder in (that contains the Package.swift file), make sure to drop it on the top level project. Only then did Xcode recognise it as a local package correctly, also overriding the non-local package dependency in the project.

Rich
  • 111
  • 7
0

As it seems you can drag&drop the folder containing your framework project into your apps Xcode project and then link it as target dependency. You can read the full thread in the Swift forum below:

https://forums.swift.org/t/how-to-add-local-swift-package-as-dependency/26457/31

blackjacx
  • 9,011
  • 7
  • 45
  • 56
  • I have tried drag and drop the project but same issue that library not found. – Bilal Mughal Feb 09 '21 at 07:18
  • I ried to add https://github.com/WireGuard/wireguard-apple via SPM in Xcode and it was not a problem at all. Just go to `File > Swift-Packages > Add Pckage Dependency` and paste the URL above in there. Hope w speak about this Framework. Why do you want to have it locally or is remote also fine? – blackjacx Feb 09 '21 at 10:22
  • I have edit the code of wireguard now I want to integrate the wireguard in my another application thats why i have to add it locally. – Bilal Mughal Feb 09 '21 at 11:22
  • Okay in that case you should try https://stackoverflow.com/a/56641364/971329 – blackjacx Feb 09 '21 at 11:56