Build failure after running pod update - ios

I ran pod update and two libraries were updated. I then opened xcode and tried to build and run the application but the libraries that were updated both failed to build, one gave 65 compile errors and the other gave 27.
I have tried
Updaing cocoapods to the latest version but it made no difference
pod cache clean --all, also no difference
Confirmed ONLY_ACTIVE_ARCH is set the same in the pods and my app (both set to yet)
Reverting to the pervious versions of the libraries, still have compile errors despite them being in use for months before this without a problem
The libraries not compiling are SwiftyJSON and Kingfisher.
Here is a sample of the errors being produced, the selected error in the left pane is the top error in the right pane.
What other issues could be causing this problem?
Edit: The pod file
source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '8.0'
use_frameworks!
pod 'Starscream', '~> 0.9.3'
pod 'Kingfisher', '~> 1.5'
pod 'MBProgressHUD', '~> 0.9.1'
pod 'SwiftyJSON', :git => 'https://github.com/SwiftyJSON/SwiftyJSON.git', :branch => 'master'

So I dont actually have a solution as to what was causing this but updating to Xcode 7 fixed it.

Related

Install New Cocoapods without changing existing Dependencies?

Working from an app that's pushing 8 years old now. Was written in Objective C. The podfile looks like this.
platform :ios, '6.0'
pod 'AFNetworking', '~> 1.2.0'
pod 'MBProgressHUD', '~> 0.6'
platform :ios, '7.0'
pod 'MessageBanner', '~> 1.0'
I'd like to add new pods to the project. Namely, Stripe. Stripe runs successfully on my local machine from a different Xcode project that uses this podfile syntax.
platform :ios, '9.0'
target 'Superapps' do
use_frameworks!
pod 'Alamofire', '~> 4.5'
pod 'AlamofireImage', '~> 3.3'
pod 'Stripe'
pod 'Cards'
end
Is there a way to run a terminal command that can add the new pods to the project while leaving the existing dependencies intact? Whenever pod install or pod install --no-repo-update is used after adding the new pods to the project, an eventual compiler warning no such module stripe is displayed by Xcode. Is there a way to fix this?
For the life of me, every edit that has been tried, including changes to the podfile and a slew of different terminal commands either produce an App project that can run the dependencies before the update but always the no such module stripe warning error. I've contacted Stripe, and am now in communication with Apple for their Code Level Support for the Apple developer program.
Note: Apple has expressed that their code level support only pertains to Apple frameworks...

Cocoapods : target has transitive dependencies that include static binaries when installing 'VialerSIPLib'

I'm trying to install an objective-c Wrapper for Jsip 'VialerSIPLib' and use it in my swift project here is my pod
platform :ios, ’10.0’
use_frameworks!
target 'EMedicalAdmin' do
pod 'ObjectMapper', '~> 2.1'
pod 'Alamofire', '~> 4.3'
pod 'SwiftyAvatar', '~> 1.0'
pod 'AlamofireImage', '~> 3.1'
pod 'Eureka', '~> 2.0.0-beta.1'
pod 'JSQMessagesViewController', :git => 'https://github.com/jessesquires/JSQMessagesViewController.git', :branch => 'develop'
pod 'PKHUD', '~> 4.0'
pod 'Firebase/Core'
pod 'Firebase/Messaging'
pod 'ImageSlideshow', '~> 1.1.0'
pod 'SwiftyJSON'
pod "FlexibleSteppedProgressBar"
pod 'BTNavigationDropdownMenu', :git => 'https://github.com/PhamBaTho/BTNavigationDropdownMenu.git', :branch => 'swift-3.0'
pod 'VialerSIPLib'
end
but i get this error when installing :-
target has transitive dependencies that include static binaries:
and if i remove
use_frameworks!
from my podfile it would work but all my other swift based pods won't work
so, i'm left with using only this one pod (VialerSIPLib) or Use all my other pods except it
Please add this to your podspec: s.static_framework = true
This is available from cocoapods version 1.4.0.
It worked for me.!!
use_frameworks! should be enough but sometimes the pod.lock file gets corrupted.
So you can delete the pod.lock file and then do
pod repo update and pod install
if any one is Still wondring ,it can't be Done
Using dynamic vendored frameworks shouldn't be a problem even if the
developer isn't using CocoaPods with use_frameworks!, unless they for
some reason need a static lib, such as if building a command line
tool, where static linking is preferable.
So .You Could add the static library manually and link it in you project or wait for the vendor to Change the library into a dynamic Framework
More info here
For me this is how i solved it :-
1- Downloaded the static library using Cocoapods without use_frameworks!
2- used Carthage for Adding other libraries
3- and if a library Doesn't have a Carthage support i would do it manually (Not advised since alot of Duplicate dependencies may Appear)
I put up a repo to show how to do: https://github.com/Lucashuang0802/CocoaPodsWithCarthage
There are a couple things to do:
- install your objective-c lib via CocoaPods without indicating use_framework! in the Podfile
- install your pure Swift module via Carthage
You should be able to compile fine with this solution.
It's a weird one.
For me uninstalling and installing again worked.
Steps -
Comment(#) the error causing pod in pod file
Pod install
Uncomment the line in pod file and save
Pod install

How to solve Xcode build error "No such module RxCocoa"?

I'm very new on Mac / iOS development with Xcode and I have trouble on building my App. I work since 4 days on that issue, but I have no more ideas to find the reason.
The App has 6 projects, bundled in a xcworkspace. I added via cocoapods and via terminal with command pod install RxSwift, RxCocoa, OMGHTTPURLRQ, PromiseKit and SVWebViewController successfully. The projects without dependencies could build successfully. Two projects (libraries) with command "import RxCocoa" and "import RxSwift" in *.swift files are failed with error "No such module 'RxCocoa'".
I read some Stackoverflow posts and the RxSwift Git documentation to solve the issue, without success.
Screenshot of build error and added reference
Podfile definition:
source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '9.1'
use_frameworks!
target 'CheckMyBus' do
pod "OMGHTTPURLRQ", "~> 3.1.2“
pod "RxSwift", "~> 2.3.0"
pod 'RxCocoa', '~> 2.3.0'
pod 'PromiseKit', '~> 3.2.1'
pod 'SVWebViewController', '~> 0.2‘
end
Pods installation via terminal:
MacMinis-Mac-mini:CheckMyBus MacMini$ pod install
Analyzing dependencies
Downloading dependencies
Using OMGHTTPURLRQ (3.1.3)
Using PromiseKit (3.2.1)
Using RxCocoa (2.3.1)
Using RxSwift (2.3.1)
Using SVWebViewController (0.2)
Generating Pods project
Integrating client project
Sending stats
Pod installation complete! There are 5 dependencies from the Podfile and 5 total pods installed.
[!] Your Podfile has had smart quotes sanitised. To avoid issues in the future, you should not use TextEdit for editing it. If you are not using TextEdit, you should turn off smart quotes in your editor of choice.
[!] The `CheckMyBus [Debug]` target overrides the `EMBEDDED_CONTENT_CONTAINS_SWIFT` build setting defined in `Pods/Target Support Files/Pods-CheckMyBus/Pods-CheckMyBus.debug.xcconfig'. This can lead to problems with the CocoaPods installation
- Use the `$(inherited)` flag, or
- Remove the build settings from the target.
[!] The `CheckMyBus [Release]` target overrides the `EMBEDDED_CONTENT_CONTAINS_SWIFT` build setting defined in `Pods/Target Support Files/Pods-CheckMyBus/Pods-CheckMyBus.release.xcconfig'. This can lead to problems with the CocoaPods installation
- Use the `$(inherited)` flag, or
- Remove the build settings from the target.
MacMinis-Mac-mini:CheckMyBus MacMini$
Can anybody help me?
I solved the issue. The solution was so simple, but I had previously found no documentation to use pods with several libraries.
I forgot to add pods definitions in the Podfile for the libraries.
source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '9.1'
workspace 'MyWorkspace'
use_frameworks!
target 'MainProj' do
pod "OMGHTTPURLRQ", "~> 3.1.2“
pod "RxSwift", "~> 2.3.0"
pod 'RxCocoa', '~> 2.3.0'
pod 'PromiseKit', '~> 3.2.1'
pod 'SVWebViewController', '~> 0.2‘
project 'MainProj'
end
target 'Lib1' do
pod "RxSwift", "~> 2.3.0"
pod 'RxCocoa', '~> 2.3.0'
project 'Lib1/Lib1.xcodeproj'
end
target 'Lib2' do
pod "OMGHTTPURLRQ", "~> 3.1.2“
pod "RxSwift", "~> 2.3.0"
pod 'RxCocoa', '~> 2.3.0'
project 'Lib2/Lib2.xcodeproj'
end
Note: Build works, but not Test! Explanation: CocoaPods Podfile config issue. The given pod/framework is specified for the non test main target, maybe even for the (unit) Test target, but not for the UI Test target! E.g.: platform :ios, '9.0' use_frameworks! target 'Xyz' do pod 'MessageK…

Xcode can't find interface declaration after running "pod install"

I've inherited an iOS project which uses cocoapods.
The repo includes the Pods directory with all the necessary pods frozen in time. If I clone the repo and build the app, all is fine. If I run pod update and then build, I get an error:
Cannot find interface declaration for COOperation.
The issue seems to be with a library called CompositeOperations, which is pulled in from a specific git account (not from cocoapods directly - not sure if that matters but just trying to give as much info as possible). Xcode is finding the library just fine, but for some reason it's not loading the Class declared in the interface file.
It seems silly to me to include the Pods directory in the repo. I feel like developers should clone the repo and then issue git install in order to pull down all dependancies.
Any suggestions for what I need to tweak in order for Xcode to successfully build my project?
The actual error in MessageScreenDataFetchOperation.h is:
/Users/user/src/myapp/myapp-iOS/Classes/Shared/Operations/MessageScreenDataFetchOperation.h:13:46:
Cannot find interface declaration for 'COOperation', superclass of
'MessageScreenDataFetchOperation'; did you mean 'NSOperation'?
And here's what MessageScreenDataFetchOperation.h looks like:
#import <CompositeOperations/COOperation.h>
#protocol GroupRef;
#interface MessageScreenDataFetchOperation : COOperation
- (id)initWithMessageId:(NSNumber *)messageId group:(id <GroupRef>)groupRef memberId:(NSNumber *)memberId;
#end
Here's my Podfile:
platform :ios, '8.0'
source 'https://github.com/CocoaPods/Specs.git'
target :MyTarget do
pod 'RestKit', '~> 0.24.0'
pod 'CompositeOperations', :git => 'https://github.com/stanislaw/CompositeOperations.git'
pod 'MBProgressHUD', '~> 0.8'
pod 'EKKeyboardAvoiding', '~> 2.0'
pod 'RBStoryboardLink', '0.1.0'
pod 'SWRevealViewController', '~> 2.0.0'
pod 'youtube-ios-player-helper', :git => 'https://github.com/stanislaw/youtube-ios-player-helper', :branch => '0.1.1-and-no-ads'
pod 'SZTextView'
pod 'MagicKit', :git => 'https://github.com/stanislaw/MagicKit'
pod 'ECPhoneNumberFormatter', :git => 'https://github.com/enriquez/ECPhoneNumberFormatter.git'
pod 'SSKeychain'
pod 'Mantle'
pod 'RSEnvironment', :git => 'https://github.com/rabovik/RSEnvironment'
pod 'FBSDKCoreKit'
pod 'FBSDKLoginKit'
pod 'FBSDKShareKit'
# Analytics
pod 'FlurrySDK', '5.1.0'
pod 'Fabric'
pod 'Crashlytics'
pod 'NewRelicAgent'
# Logging
pod 'EchoLogger', :git => 'https://github.com/stanislaw/EchoLogger'
pod 'AFNetworkingLogger', :git => 'https://github.com/stanislaw/AFNetworkingLogger'
end
target :MyTargetUnitTests do
pod 'OCMock', '~> 3.0'
pod 'Kiwi'
pod 'JPSimulatorHacks', :git => 'https://github.com/plu/JPSimulatorHacks'
end
Have you tried adding CompositeOperations without using pods? That pod seems outdated to cocoapods:
https://cocoapods.org/?q=CompositeOperations
Turns out the version that was baked in to the Xcode project was a much older version. The Podfile didn't restrict by version number, so running 'pod update' updated the library to the latest version, which had significant changes, making it incompatible with my code base.
I figured it out by diffing Podfile.lock after running pod update and noticing the drastic difference in versions.
I went forward with deleting the Pods directory and the .xcworkspace file, but amended the Podile to restrict the library based off a specific tag.

Realm lexical or preprocessor 'RLMAccessor.h' file not found

I wanted to write some unit tests using GRUnit & OCMock for an app using Realm. Even though the pods are installed and the paths should be correctly set, Xcode can't seem to find a number of files like RLMAccessor.h.
I get an "lexical or preprocessor issue"
I've tried a bunch of things like removing realm, downgrading, updating cocoapods, clearing the cache, adding the libraries and so on but nothing
seemed to work.
Anyone been able to set up Realm to work with GRUnit?
EDIT this how my pod file's set up. I'm using cocoapods but including real/headers didn't work for my test target.
target: myApp do
pod 'Realm' , '~> 0.92.2'
pod 'Localytics', '~> 3.1.1'
end
target :test do
shared_pods
pod 'Realm/Headers'
pod 'GRUnit', '~> 1.0.1'
pod 'OCMock', '~> 3.2.1'
end
Using Realm 0.92.2, Xcode 6.3.1
So I fixed it by upgrading to a newer GRUnit version then downgrading agin because GRUnit didn't work anymore and removing pod 'Realm/Headers' with pod 'Realm' and ran pod install again.

Resources