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

2 Answers 2

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.

Sign up to request clarification or add additional context in comments.

Comments

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

4 Comments

I have tried drag and drop the project but same issue that library not found.
I ried to add 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?
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.
Okay in that case you should try stackoverflow.com/a/56641364/971329

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.