CocoaPods update RestKit #import "RKObjectMapping.h" file not found - ios

I want to update some of my project pods and after run pod update "some_framework" and try to build project appear this error:
import "RKObjectMapping.h" file not found
Current CocoaPod version is 0.39.0 I have tried to downgrade to 0.38.2 and lower but without any success, XCode version is 6.4 I have tried to change configuration of search path in Build Setting from non-recursive to recursive but again without success.
So I don't know what to do next, because I need to do some updates in project and RestKit is main framework for working with server side.
Podfile:
source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '7.1'
pod 'RestKit', '~> 0.24.1'
pod 'EZForm', '~> 1.1.0'
pod 'OCMock', '~> 3.0'
pod 'ImoDynamicTableView', '~> 1.1.273'
pod "ImoDynamicPopUp"
pod 'Masonry', '~> 0.6'
This is how error looks like, in Xcode: Error image

A little late to the party,I had same issue with cooca pod 0.39.0 and restkit 0.24.1 updated restkit to 0.26.0 and issue was fixed

Imports in public header files should be #import <RestKit/Subdirectory/RKHeader.h> instead of #import "RKHeader.h"
This is required for RestKit to be compatible with future CocoaPods version because of CocoaPods/CocoaPods#4057 (The HEADER_SEARCH_PATHS will no longer be constructed recursively) introduced in 0.39.0.beta.1.

I know this is old, but the easiest way to fix this is to add ${PODS_ROOT} (and set it to recursive) in Header Seach Paths under Build Settings in your target settings.

Had same issue few days ago. It seems that I had two CocoaPods version 0.39.0 and 0.38.2. When I removed 0.39.0 and updated pods it worked.
Use gem list in terminal to see installed gems.

I had the same issue, I did use 0.26.0 version of Restkit but 0.38.2 of cocoa pods. The only thing I'd to change after was selecting "Project Pods", and in "Build Settings -> Build Active Architecture Only" change to NO
[UPDATE]!!!!
You can now follow the answer from #sajjon in this post from github to use cocopods versions: 0.39.0, 1.0.0 and 1.0.1
if anyone is having problems with RestKit 0.26.0 and Cocoapods 1.0.1,
hopefully this will help!
This solution worked at least on 2016-06-03, but since it uses
specific git branches maybe these will be merged, so if this does not
work for you please check if this git branches have been
merged/moved/deleted.
Clean up before everything
Quit Xcode
rm -rf Pods
rm -rf MyApp.xcworkspace
rm -rf ~/Library/Caches/CocoaPods
rm -rf ~/Library/Developer/Xcode/DerivedData
Use mcfedr's RestKit fork
Must be used together with "reachablility" branch of AFNetworking
pod 'AFNetworking', :git => 'https://github.com/mcfedr/AFNetworking.git', :branch =>
'reachability'
pod 'RestKit', :git => 'https://github.com/mcfedr/RestKit.git', :branch => 'pods1' Use module
import syntax in Bridging Header
#import RestKit;

Updated to Cocoapods 1.1.1 and RestKit 0.26.0 and it works fine.

Related

CocoaPods - A custom dynamic framework - cannot get the latest version of frameworks

My project in Xcode consist of static frameworks and one custom dynamic framework. This dynamic framework includes some other static frameworks.
When I try to compile the custom dynamic framework itself, everything is fine. I was able to force to install latest version of frameworks (Alamofire, Realm, etc..) by forcing the pod definition file
platform :ios, '9.0'
But when I compile my project even when I use the above line, I am getting the old frameworks.
When I try to force the pods for a explicit version,
pod 'Alamofire', '~> 4.4.0'
getting the version 3.5.1.
Is there any other explicit setting to force CocoaPods to be more accurate in versions?
Originally the project for the dynamic framework was made for the Swift version 2.3, which is actually requiring the version of Alamofire 3.5.1.
Any help will be appreciated.
Maybe try the following in your podfile:
pod 'Alamofire', :git => 'https://github.com/Alamofire/Alamofire.git', :tag => '4.4.0'
That will bypass your local spec repo and get straight from git.
Which version of CocoaPods you have currently installed on your machine? Which version was used to originally establish Pods in project? I've spotted an issue when I updated CocoaPods, that pod update hasn't been working properly, and removing just Podfile.lock and Pods/ directory wasn't sufficient to make things right.
That said I would do the following:
update CocoaPods to newest version
pod repo update for newest Pod specs
pod deintegrate to completely remove Pods from project
pod install to re-create Pods in the project
The solution is kinda tricky. I haven't realise in the beginning that the pods under a dynamic framework cannot actually be executed directly from top project and there is a configuration JSON file, which actually is managing the pods under the dynamic framework.
So the pod versions were actually hardcoded there.

Always get build error : No such module 'Alamofire'

I followed the instruction of Alamofire in github,
I created an xcode project named cocoapods-test & I closed it.
I go to the project folder run pod init command which generates a Podfile. Then I added the following code to the Podfile:
source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '8.0'
use_frameworks!
pod 'Alamofire', '~> 3.0'
Then, I run command pod install and this is the result in terminal:
Updating local specs repositories
CocoaPods 1.0.0.beta.6 is available.
To update use: `gem install cocoapods --pre`
[!] This is a test version we'd love you to try.
For more information see http://blog.cocoapods.org
and the CHANGELOG for this version http://git.io/BaH8pQ.
Analyzing dependencies
Downloading dependencies
Installing Alamofire (3.3.0)
Generating Pods project
Integrating client project
[!] Please close any current Xcode sessions and use `cocoapods-test.xcworkspace` for this project from now on.
Sending stats
Pod installation complete! There is 1 dependency from the Podfile and 1 total pod installed.
Then, in my project folder there is a new file called cocoapods-test.xcworkspace . I double clicked it which opens my xcode again, and I can see the Alamofire module.
Then, I opened my project's ViewController class, and import Alamofire . But no matter how many times I clean & build, I always get error No such module 'Alamofire' . Here is the screenshot:
Why I get this problem though I followed the instruction step by step?
(I am using XCode 7.2.1, Swift 2.1.1 & Alamofire 3.3.0)
======= UPDATE ========
I tried #LK Yeung 's answer, uncomment import Alamofire, then clean & build again, I got a bunch of compiler errors from Alarmofire:
You need to build the project successfully once before using the library
comment import Alamofire -> build -> uncomment import Alamofire
Make sure you have opened the "project_name".xcworkspace instead of "project_name".xcodeproj .As you are working on pods all the installed pod will be available only in your .xcworkspace project file.
I was having this exact same problem. Please make sure that you are on Xcode 7.3 and using Swift 2.2.
You can check your Swift version using xcrun swift -version. Updating Xcode to 7.3 should also automatically update Swift.
Updating Xcode resolved this issue for me.
You need to add the lib to 'the Link Binary With Libraries' section also
You can try put pod 'Alamofire', '~> 3.0' like below. And run pod install again.
target 'yourtarget' do
pod 'Alamofire', '~> 3.0'
end
If you're manually installing Alamofire (or any other framework) make sure your build configurations match between both your parent project and the sub project. For example, if your build configuration in your project is called 'Development', but Alamofire's is called 'Debug' you'll get the 'no such module' error.
Follow This Sequence
➼ Open Terminal, go to the project folder and run these commands:
sudo gem install cocoapods -n /usr/local/bin
pod install
➼ Go to this link and clear derive data folder:
~/Library/Developer/Xcode/DerivedData
➼ Then open project "xcworkspace" file and press:
Command + Shift + K
➼ and then:
Command + B
It should work now
Cheers!
try to latest updated install alamofire and also check u use alamofire latest is this in your xcode supported.
source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '10.0'
use_frameworks!
target '<Your Target Name>' do
pod 'Alamofire', '~> 4.4'
end
try this above alamofire on your podfile
I had the same issue, the reason was that I installed the wrong version of alamofire.
I am using Xcode 7.3, swift 2.2, so alamofire 3.0 worked for me
remove the library using these steps mentioned by #Michal
Remove or uninstall library previously added : cocoapods
Then in your pod file
source 'https://github.com/CocoaPods/Specs.git'
platform :ios, ‘9.3’ <-- your target version
use_frameworks!
target ’<your target name>’ do
pod 'Alamofire', '~> 3.0’
end
No such module 'Alamofire' Error
because you have not installed the Alamofire in your pod file
open Podfile and add this line
pod 'Alamofire'
double-check in Podfile if this line already is written then no need to write. then just update pod file
for updating your pod open your Podfile into terminal and dial
pod update

How to get latest GoogleMaps SDK using pods

I'm trying out the google places sdk sample. I installed it using
pod try GoogleMaps
I installed GoogleMaps (1.10.5) using cocoapods
source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '8.1'
pod 'GoogleMaps'
checking the GoogleMaps in both steps, the one in the sample (1) contains more headers like GMSAutocompleteTableDataSource.h
Why are they different? The one in the sample seems to be a better version but the one given by pods is not the latest? Its not even in the changelog
Run pod update GoogleMaps. Cocoapods won't update the version of a pod you've already downloaded unless you explicitly run pod update or update the podspec to require a newer version. See https://guides.cocoapods.org/using/pod-install-vs-update.html for more details.
I checked the latest podspec
I just need to set the version to the latest
e.g
pod 'GoogleMaps', '~> 2.5.0'
In my project's podfile, I don't specify the version. The pod line just specifies: pod 'GoogleMaps'
So, if you don't include the version in the podfile, then the following command in a Terminal window will update to the latest version: pod 'GoogleMaps'
Please ensure the you are in the correct folder containing your podfile before entering this command.
It may take a while for Pod to process when you see this message: Updating local specs repositories.
Be patient - it took about 20 minutes.
I just ran into this error, and I updated to latest GoogleMaps per the advice above, but had to delete the app on my device and install fresh for it to resolve the error. Error was still present until I did that.

Xcode Architecture issue

I am using xcode 6.4 in my project, it contains cocoapods where Pods are as follows:
pod 'ZXingObjC', '~> 3.0'
pod 'Google-Mobile-Ads-SDK'
pod 'iRate'
pod 'NewRelicAgent'
pod 'GoogleAnalytics'
pod 'Appirater'
pod 'Crashlytics'
But, after I update my pods I am getting the error which I attached to this image: Error is becuase of one pod
Need One project prefix header file
And add in bulid setting this .pch file.
So
FOR OBJECTIVE_C
yes this podfile should work,
FOR SWIFT add,this line too
use_frameworks!
YOU DON'T HAVE TO MENTION THE VeRSION OF ANY LIBRARY IF NOT MENTIONED ON COCOAPODS.
Lastly if you have taken care of all these
then try cleaning project cmd
+ shift+ k and then run project.
If still not working then delete manually the dependencies folders and reinstall them
# if there is problem with Google MobileAds-ios-Sdk, then you are stuck. Because there is some problem with them, and hence it would be better to install Google MobileAds-ios-Sdk manually only

Restkit via cocoapods fails to build on new project, RKLog not found

I'm trying to use Restkit via CocoaPods for my first time, on a brand new project, but I encounter some issues building the project once Restkit is introduced:
I have followed these exact steps:
Created a brand new Xcode project, default options.
Created a podfile with the following contents :
platform :ios, '6.1'
pod 'RestKit/Testing', '~> 0.20.0pre'
pod 'RestKit/Search', '~> 0.20.0pre'
Run pod install then opened the workspace
Updated the prefix file as instructed here.
I'm running these versions, all valid according to the Restkit documentation:
Git git version 1.8.1.2
CocoaPods 0.16.2
Xcode 4.6
Can anyone suggest what I may have done wrong, or what I can do to solve this? Thanks
You have to include the base of Restkit as well. Add
pod 'RestKit', '~> 0.20.0pre'
To your Podfile.
Found a solution described here.
It involves searching the project for #import and replacing it with #import . The project compiles!
//#import <RestKit/RestKit.h>
#import <RestKit/CoreData.h>
In this case the offending file was RKOperationStateMachine

Resources