Cannot fix "Could not find or use auto-linked library "

In my case, it was a React-Native project after adding a Swift Pods library.

Solution 1:

  1. Adding a new Swift file and a Bridge header:
  1. File -> New -> File File -> New -> File

  2. Select Swift File Select Swift File

  3. Confirm Create Bridging Header enter image description here

Solution 2:

  1. Go to Build Settings and set Always Embed Swift Standard Libraries to YES Always Embed Swift Standard Libraries

Apple mentioned similar issue in known issues section:

Targets that contain Swift code with the Enable Bitcode build setting set to Yes fail to link correctly when built with the Archive action.

And give us a workaround:

Add a custom build setting with the name LD_VERIFY_BITCODE, and set it to NO. Make a note to yourself to delete this custom build setting once this issue is resolved.


I had a same error... my problem solved with -> add the library (framework) in the Frameworks and Libraries that you used in any target

for Example :

enter image description here


My ObjectiveC project was including a Swift pod which was then throwing the above errors. I found all I had to do was add a swift header file into the base of my project and it suddenly all built.

What gave it away for me was when I went into the Build Settings of my Target project and did a search for 'swift' I was only seeing a very minimal amount of results when I knew I should be seeing more - after adding the header file I suddenly saw a lot more options here. Below are the steps I took.

  1. Right click on your root project in the Project Navigator
  2. Select 'New File'
  3. Select a 'Swift File'
  4. Give it a name of 'BridgeHeader' (you don't need to specify the .swift - it'll add the extension automatically)
  5. Run a clean + build and hopefully the errors will have disappeared!

I'm unsure if the name is important, nor am I sure on the position of the file but this is what worked for me!

Tags:

Ios

Xcode

Swift