The problem:
We had a build on the App Store which worked perfectly, then I pulled the same commit from the Git, and the compiler was constantly alerting some missing modules. This was weird cause all of the modules were there, no change was made, and on the machine (device) of my colleague wasn't showing any error.
The error is:
No such module 'NameOfModule'
Firstly it started to show on:
import IdensicMobileSDK
After a few Cleans of Build Folder, it's not showing any more on that part.
Now is showing on:
import MaterialComponents.MaterialTextControls_FilledTextFields
This is happening on my machine (device) after pulling it from Git, on my colleague's machine (device) is working great (running and building without any errors).
What steps I took to fix it:
Clean Build Folder
Delete Xcode
Delete Cocoapods on Mac
Delete Git
Delete Homebrew
Re-install everything
None of them worked. Only pod install fixed this error, but it modified some Pod files and caused other errors. It was weird why it modified Pod files when nothing was changed.
Just in case you need to see the Podfile:
# Uncomment the next line to define a global platform for your project
# platform :ios, '9.0'
source 'https://github.com/CocoaPods/Specs.git'
source 'https://github.com/SumSubstance/Specs.git'
target 'project' do
# Comment the next line if you don't want to use dynamic frameworks
use_frameworks!
# Pods for project
pod 'Alamofire', '~> 5.0.0'
pod 'Kingfisher', '~> 5.12.0'
pod 'ReachabilitySwift', '~> 5.0.0'
pod 'SwiftKeychainWrapper', '~> 3.4.0'
pod 'Firebase/Crashlytics', '~> 7.6.0'
pod 'Firebase/Analytics', '~> 7.6.0'
pod 'Firebase/Messaging', '~> 7.6.0'
pod 'Firebase/DynamicLinks', '~> 7.6.0'
pod 'MaterialComponents'
pod 'lottie-ios', '~> 3.1.8'
pod 'IQKeyboardManager', '~> 6.5.5'
pod 'Toast-Swift', '~> 5.0.1'
pod 'SwiftLint', '~> 0.40.1'
pod 'UPCarouselFlowLayout', '~> 1.1.2'
pod 'SOPullUpView', '~> 1.1.0'
pod 'PieCharts', '~> 0.0.7'
pod 'IdensicMobileSDK'
pod 'TagListView', '~> 1.0'
pod 'DropDown'
pod 'MnemonicSwift'
target 'project-iosTests' do
inherit! :search_paths
# Pods for testing
end
target 'project-iosUITests' do
# Pods for testing
end
end
What could be the issue and how to fix it?
Thank you in advance.
Related
i am relatively new in ios, especially cocoa pods. i ran into a problem,somehow the IgListKit dependency is un-importable, I already clean build, build 1st then add the import, even deleting the xcworkplace and adding a new one by doing pod install
How do I fix it? is it an issue within the Pod? should I file an error? Thank you
How I add the dependencies :
# Uncomment the next line to define a global platform for your project
platform :ios, '12.0'
target 'LearnViper' do
pod 'Alamofire', '~> 5.4'
pod 'RxSwift', '6.2.0'
pod 'RxCocoa', '6.2.0'
pod 'Kingfisher', '~> 7.0'
pod 'SkeletonView'
pod 'IGListKit', '~> 4.0.0'
end
platform :ios, '12.0'
target 'LearnViper' do
use_frameworks!
pod 'Alamofire', '~> 5.4'
pod 'RxSwift', '6.2.0'
pod 'RxCocoa', '6.2.0'
pod 'Kingfisher', '~> 7.0'
pod 'SkeletonView'
pod 'IGListKit', '~> 4.0.0'
end
you have to update your gem file with command first
sudo gem install -n /usr/local/bin cocoapods
then after that open podfile add pods and install
Looks like all you have to do is add
use_frameworks! in your pod file
I opened an iOS (Swift) project today I hadn't touched for a while and it wouldn't build. The first import statement for a Cocoapods framework was throwing a No such module compile error in Xcode. Changing the order of import statements made the error throw on whichever was the first external dependency in my import list.
I fixed this by adding each of my Cocoapods to Framework Search Paths in my project's main target (it has a few targets, including tests, a share extension, and a framework of shared code for the app and extension). These search paths were empty and now look like this:
After doing that the project built fine, but now I'm getting this SIGABRT error every time I try to run the app (both on simulator and device):
dyld: Library not loaded: #rpath/CocoaLumberjack.framework/CocoaLumberjack
Referenced from: [path removed]
Reason: image not found
My guess is this is to do with CocoaLumberjack needing to be linked somewhere else/some other way because of its macros but I don't really know.
I've also tried running pod install, cleaning the build folder and deleting derived data, and running pod deintegrate + pod install with no success.
Is it possible to get Cocoapods to automatically set up my search paths correctly so I don't have these issues? Or is there a manual step I'm missing or have done wrong perhaps?
Edited to add my Podfile:
platform :ios, '11.0'
use_frameworks!
# ignore all warnings from all pods
inhibit_all_warnings!
# This is my shared framework, used by both my app and share extension
target 'XXXShared' do
pod 'SnapKit', '~> 4.0'
pod 'KeychainSwift', '~> 7.0'
pod 'Reveal-SDK', :configurations => ['Debug']
pod 'IQKeyboardManagerSwift'
pod 'APESuperHUD', :git => 'https://github.com/apegroup/APESuperHUD.git'
pod 'WSTagsField', '~> 3.1'
pod 'Cache', '~> 4.2'
pod 'TableKit', '~> 2.5'
pod 'GRDB.swift', '~> 3.2'
pod 'PromiseKit', '~> 6.0'
pod 'Toast-Swift', '~> 3.0.1'
pod 'CocoaLumberjack/Swift'
pod 'CollectionKit'
pod 'PinLayout'
pod 'FlexLayout'
pod 'LayoutKit'
pod 'PromiseKit/Alamofire'
pod 'Alamofire', '~> 4.7'
end
target 'XXX' do
pod 'Reveal-SDK', :configurations => ['Debug']
end
target 'XXX share extension' do
inherit! :search_paths
end
Edited to add screenshots:
I have been unable to get Cocoapods to build a deployable iOS app that requires different pods for the app and the watchkit extension. I have tried a format suggested in another thread: Include pods in main target and not in WatchKit extension
but it has numerous failures, including not finding headers. Here's the closest I can get:
source 'https://github.com/CocoaPods/Specs.git'
link_with 'RailTime-WatchKit-Extension'
pod 'Reachability'
pod 'IGInterfaceDataTable'
target :'RailTime', :exclusive=>true do
pod 'ASIHTTPRequest', '~> 1.8.2'
pod 'BPXLUUIDHandler', '~> 0.0.1'
pod 'MBProgressHUD', '~> 0.9'
pod 'Appirater', '~> 2.0.4'
end
This works fine for the simulator, but fails when trying to install on a device. The first error is:
ld: library not found for -lPods-RailTime-WatchKit-Extension
I'm using the latest Cocoapods right now .37. No errors are generated when performing a pod install.
Any help would be greatly appreciated!
Ken
Here's the general format that I use for my WatchKit app. See if this helps:
source 'https://github.com/CocoaPods/Specs.git'
target 'RailTime-WatchKit-Extension' do
link_with 'RailTime-WatchKit-Extension'
pod 'Reachability'
pod 'IGInterfaceDataTable'
end
target :'RailTime' do
link_with 'RailTime'
pod 'ASIHTTPRequest', '~> 1.8.2'
pod 'BPXLUUIDHandler', '~> 0.0.1'
pod 'MBProgressHUD', '~> 0.9'
pod 'Appirater', '~> 2.0.4'
end
OK, the solution was quite simple, even though I'm not sure why it worked. As suggested in another thread, I did a 'pod init', which now creates a template that is knowledgable about the multiple targets. I then just filled it in! Here's what I have now:
platform :ios, '8.2'
source 'https://github.com/CocoaPods/Specs.git'
target 'RailTime' do
pod 'Reachability'
pod 'ASIHTTPRequest', '~> 1.8.2'
pod 'BPXLUUIDHandler', '~> 0.0.1'
pod 'MBProgressHUD', '~> 0.9'
pod 'Appirater', '~> 2.0.4'
end
target 'RailTime-WatchKit-Extension' do
pod 'Reachability'
pod 'IGInterfaceDataTable'
end
target 'RailTime-WatchKit-App' do
end
I'm working on a legacy iOS project as a newbie. After I updated the CocoaPods and libraries, I've got these weird errors after building the project which never happen before.
error: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool: can't locate file for: -lPods-Model
error: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool: file: -lPods-Model is not an object file (not allowed in a library)
And here is my Podfile:
platform :ios, '7.0'
link_with ['DianaViewModels']
pod 'AVOSCloud', '~> 3.0'
pod 'PixateFreestyle'
target :Model do
link_with ['DianaModels']
pod 'ReactiveCocoa', '~> 2.2'
pod 'TMCache', '~> 1.2'
pod 'SSKeychain', '~> 1.2'
pod 'Mantle', '~> 1.3'
pod 'AFNetworking', '~> 1.0'
end
target :Test do
link_with ['DianaTests']
pod 'Kiwi', '~> 2.2'
end
target :View do
link_with ['Diana']
pod 'SVPullToRefresh', '~> 0.4'
pod 'MBProgressHUD', '~> 0.7'
pod 'SWTableViewCell', '~> 0.1'
pod 'MTMigration'
pod 'Masonry'
pod 'TTTAttributedLabel'
pod 'NJKWebViewProgress'
target :ViewDebug do
link_with [
'DianaDev',
'DianaViews'
]
pod 'Reveal-iOS-SDK'
end
end
By the way, I'm using the CocoaPods plugin in the Xcode. But a lot error are output when I check the Install Docs during integration:
Error opening xar archive: /var/folders/3x/mgl299js6k13tlrspqv21n340000gn/T/Model-ReactiveCocoa.xar
Are there some wrong configurations in my CocoaPods or Build Setting in Xcode6.3? Thanks for your help!
ADDED:
Here's my Link Binary With Libraries in the Build Phases. Does the red item mean something is wrong? It looks like this is the cause.
There are pod files installed in my project.
Now I want to add new pod file for 'PhotoPickerPlus' , but I am getting duplicate symbols errors and warnings as seen in following screenshot ;
I have tried to install pod file by using
pod install
It is successfully installed. I have also inclueded all required frameworks.
My pod file is as follows ;
platform :ios, '6.0'
# ignore all warnings from all pods
inhibit_all_warnings!
pod 'ARGenericTableViewController', '~> 1.0.0'
#pod 'CocoaLumberjack', '~> 1.6'
pod 'TBXML', '~> 1.5'
pod 'GoogleAnalytics-iOS-SDK', '~> 2.0beta4'
#pod 'FlurrySDK', '~> 4.1.0'
pod 'SDWebImage', '~> 3.5.4'
#pod 'PSTCollectionView', '~> 1.2.0'
pod 'BSKeyboardControls', '~> 2.2'
pod 'HockeySDK', '~> 3.5.4'
pod 'MBProgressHUD', '~> 0.8'
pod 'MKMapView+AttributionView', '~> 0.1.0'
pod 'Facebook-iOS-SDK', '~> 3.13.0'
pod 'TTTAttributedLabel', '~> 1.9.0'
pod 'JASidePanels'
#pod 'ARChromeActivity', '~> 1.0.1'
#pod 'TUSafariActivity', '~> 1.0.0'
pod 'REComposeViewController', '~> 2.3.1'
pod 'iRate', '~> 1.9.3'
pod 'PhotoPickerPlus', '~> 2.2'
pod 'UIPhotoGallery', :podspec => 'UIPhotoGallery.podspec'
But I am getting errors after installing this file.
What can be the issue?
Maybe your Other Linker Flags inside the Build Settings inside your project is set wrong. Click on your Project inside Project Navigator. If you select your app on PROJECT your Build Settings should look like this
Inside my project I also deleted everything inside Other Linker Flags but maybe it works for you if you insert this
And of course never forget cleaning after these steps.
In you Project Settings, Check target's "Build Phases"'s "Compile source" section. Make sure there are no duplicate copies.
BTW, These errors are generated by https://github.com/gameclosure/trademob which is not even in your pod file.
So again, verify your project settings. Probably you are trying to add pod file to existing project.