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
, thenpod 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
andx86_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
3
Answers
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 aPodfile
into that directory with your above contents but with the nameprojectname
replaced withemptyproj
, you can then doand then once it has created
emptyproj.xcworksapce
open it in Xcode.You will notice that there is no symbol called
AnimationView
. There is onlyLottieAnimationView
.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).
This looks like you have different version of lootie , ask your coworker to check version he is currently using
for this you can use command:
When you run pod outdated, CocoaPods will list all pods that have newer versions that the ones listed in the Podfile.lock
then
use pod with specyfic version like this:
instead of:
If you didn’t add version when you run ‘pod install’ you will get newest available version.
and AnimationView is part of lottie liblary.
After adding version number run ‘pod install’.
In such a case you can ask for the Podfile.lock of your co-worker and can check for the already installed specific version of the relevant pod, and if there any mismatch with there installed version with yours, update your pod file by adding that version and then pod install. and also if you guys don’t need to work with latest version of the pods it is always better to use pod with versions.