Grinarn Grinarn - 4 months ago 18
Swift Question

Swift project build on one machine but not on a new mac

We have a Swift Project where we use fastlane as build tool and CocoaPods for dependency management. Everything works fine on the development machine.

If we checkout the project on our new build server Mac Mini, we get the following error:


/Applications/buildAgent/work/1e0861a2675353b6/Appname/AppDelegate.swift:10:8: could not build Objective-C module 'HockeySDK'


The same lane on our development machine works perfectly fine. What are we missing here?

The XCode and Cocoapods Versions are the same on both machines.

Answer

I ran into same problem with a framework 'RealmSwift'.

For me the problem was.

Source control

Some of the files from frameworks were not included in the commit. I was using Xcode to commit & push the code.

If you are using git, check if some of the files are missing by running 'git status' on the machine that has working copy of code. Solution was to simply add the required missing files inside the project to git.

If that doesn't work you can try

Reinstalling the pods.

  1. Comment the frameworks in podfile.
  2. Run pod install. It shall remove all the pods.
  3. Clean the pods cache.
  4. Build the project from xcode. It will show lots of error for the missing frameworks. Close the Xcode.
  5. Uncomment all the frameworks you commented in step 1.
  6. Run pod install again. Then clean & build the project.