Search code examples
iosswiftxcodecocoapods

Swift app downloaded from source control doesn't run on my machine, runs on coworkers


A coworker and I are taking over an iOS app hosted on GitLab. This app utilizes cocoapods, and the Pods directory is included in the repo. My understanding is we should be able to pull the repo and run it on Xcode without issues.

My coworker is able to download the app from source control and run it on his machine. Mine is getting errors such as "Cannot find type 'AnimationView' in scope". He is running an M1 MacBook, I'm running an intel-based MacBook air. I'm opening the workspace file that was generated by CocoaPods, not xcodepro.

Here's a list of things I've tried:

  • Regenerating the pods via the command line by running pod reintegrate, then pod update, opening Xcode and cleaning the build folder, and then running again.
  • Changing the minimum iOS deployment target on Xcode to the highest deployment target of the pods in my podfile.
  • Changing the architectures on the app build settings to i386 and x86_64 rather than the default.
  • Clicking "Update to recommended settings" when Pods throws a warning.

None of these seem to work, I'm at a loss at this point. Since it runs on my coworker's machine I'm assuming there must be something wrong with how my app is detecting the libraries or how it's compiling.

Here's my podfile:

# Uncomment the next line to define a global platform for your project
platform :ios, '13.0'

target 'projectname' do
  # Comment the next line if you don't want to use dynamic frameworks
  use_frameworks!

  # Pods for projectname
  pod 'Purchases'
  pod 'Firebase/Analytics'
  pod 'Firebase/Core'
  pod 'Firebase/Storage'
  pod 'Firebase/Database'
  pod 'Firebase/Firestore'
  pod 'Firebase/Auth'
  pod 'SwiftyJSON'
  pod 'CleanyModal'
  pod 'MagicTimer'
  pod 'lottie-ios'
  pod 'FBSDKCoreKit'

end

Solution

  • I suspect the problem is not related to pods.

    The reason for this is if you start a fresh iOS Xcode project, called emptyproj, and then close the iOS project in Xcode, you can then go to that project directory and place in a Podfile into that directory with your above contents but with the name projectname replaced with emptyproj, you can then do

    pod install
    

    and then once it has created emptyproj.xcworksapce open it in Xcode.

    You will notice that there is no symbol called AnimationView. There is only LottieAnimationView.

    So the missing symbol must be in the actual app on GitLab, not the pod dependencies.

    What I suggest is to look at any build phases in the build of the project to see if any scripts that are architecture-specific get run.

    Another debugging strategy is to get your co-worker onto your machine and do the setup herself on your machine, which might succeed (an unmentioned step) or fail (stronger evidence that it is a machine or architecture related matter).