Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Xcode Build and Run Succeeds, but Archive Fails

My app builds and runs successfully, but archives fails, therefore I can't make an ipa file. Error log is following:

ld: library not found for -lAAMFeedback clang: error: linker command failed with exit code 1 (use -v to see invocation)

the library is this: pod 'AAMFeedback', :git => 'https://github.com/PlusR/AAMFeedback.git'

Anyone encountered the same situation before? Please share the experience to help me. Thanks,

version info:
Xcode version: 7.3.1
target ios version: 8.0

like image 911
Justin Sato Avatar asked Aug 30 '16 01:08

Justin Sato


People also ask

Why I can't archive in Xcode?

Archive menu option grayed out If you can't create an archive in Xcode, usually it's because you have the destination set to the simulator. Switch to an iOS device (it should work even if you don't have one connected). Another cause for the grayed-out archive option is that it's disabled for your scheme.

Do I need to Build before archive Xcode?

Yes you are right, you dont required 'Build' before archiving. So, you can directly archive it(it automatically going to build it). This error comes when compiler unable to find required library. So, check your Runpath search paths ( Library search paths in xcode version older than iOS 12) in build settings.

What does archive in Xcode do?

It archives your Xcode project by running the xcodebuild archive command and exports the archive into an . ipa file with the xcodebuild -exportArchive command. This . ipa file can be shared and installed on test devices, or uploaded to App Store Connect.


2 Answers

Xcode 9.0

For me what works was to go Product > Scheme > Manage Scheme and tick all the checkboxes, then Build again and then Archive.

Hopefully, this can help someone else.

like image 168
Edouard Barbier Avatar answered Oct 05 '22 06:10

Edouard Barbier


I finally managed to Archive. It was the reason why archive didn't succeed to set Product > Edit Scheme > Build setting. I unchecked 'Find implicit Dependencies' during development, which fasten the building process. However it is needed to check that setting when archiving.

enter image description here

like image 27
Justin Sato Avatar answered Oct 05 '22 06:10

Justin Sato