Library not loaded X / Multiple commands produce X, but only on some environments

472 Views Asked by At

CI and all developer environments had zero issues until a single laptop environment stopped being able to build the iOS app. The error thrown was Library not loaded: @rpath/Foo.framework/Foo

Adding this Foo framework manually via Xcode resolved the problem.

Xcode – Frameworks, Libraries, and Embedded Content

HOWEVER, it broke the builds on CI and all other developer environments. Those are now throwing the error

Error (Xcode): Multiple commands produce '/Users/admin/Library/Developer/Xcode/DerivedData/Runner-adwcstkmsmzcjgdzgisfheqwwytp/Build/Intermediates.noindex/ArchiveIntermediates/Runner/InstallationBuildProductsLocation/Applications/Runner.app/Frameworks/Foo.framework'

So we have a seesaw situation where fixing the issue on one environment breaks it on the others.

We have checked the versions of all major pieces of the toolchain (Xcode, iOS, Flutter, Cocoapods) and they are the same across all environments. We have tried reinstalling Xcode and using a fresh repository on the problematic laptop environment.

2

There are 2 best solutions below

0
Luke Pighetti On

This answer may not resolve this for everyone, but in my case it did resolve the problem.

Apparently this line was added to my .zshrc at some point, I think it was recommended by brew during installation of something. In any case, I was getting errors when trying to run arch -x86_64 pod update until I removed this:

# ruby
if [ -d "/opt/homebrew/opt/ruby/bin" ]; then
  export PATH=/opt/homebrew/opt/ruby/bin:$PATH
  export PATH=`gem environment gemdir`/bin:$PATH
fi
0
Kirti Verma On

It got fixed after I updated cocoapods to 1.12.0. You also need to remove the FBSDKCoreKit and FBSDKCoreKit_basic from Frameworks, libraries and Embedded Content section