10

I have the prelease version of cocoapods installed, 0.26, and trying to install the latest version of RestKit. In my podfile I've turned on the use_frameworks! flag to force cocoapods to use dynamic frameworks.

Putting import RestKit in my swift file causes a build failure: 'RKValueTransformers.h' file not found. RestKit is set up to use a handful of other libraries and include their headers into the project (AFNetworking, RKValueTransformers, TransitionKit, etc.)

According to an article for cocoapod authors I believe the issue is that the way to import and include these libraries need to change to work with dynamic frameworks and cocoapods. Either the autogenerated umbrella file needs to import these files for use or RestKit needs to import these libraries using @import RKValueTransformers or #import <RKValueTransformers/RKValueTransformers.h>.

I am not an expert at Objective C, Cocoapods, or RestKit so looking to see if anyone has gotten this working and I am doing something wrong or if it requires a change made to RestKit.

Rudy Mutter
  • 966
  • 1
  • 6
  • 16

2 Answers2

8

This is a bug currently in RestKit. Sam Giddin has an open PR right now that fixes the issue. I made a fork of RestKit that I'm using in my project with the commits from the PR to get around this issue until they merge in the fixes and make a new release.

Rudy Mutter
  • 966
  • 1
  • 6
  • 16
  • The PR you referenced appears to be exactly my problem, but it does not work for me (even pulling from development branch). Are you still using your fork? – Brian Butterfield Dec 07 '15 at 18:29
  • Same for me, pulling from dev branch doesnt solve the problem. Did you guys come up with something? – andrejbroncek Dec 09 '15 at 09:18
  • Its year old question, I m trying using RESTkit latest version in swift but still facing same issue, how can I fix it? – Aqib Mumtaz May 24 '16 at 11:14
0

I posted an answer to a similar question

Here a straight blunt copy of the answer, so this is not a link-only answer :)

I've had a long struggle with this, too, while I was building a private Swift-Framework-Pod that depends on RestKit. After a long fight, I forked RestKit and hacked a workaround.

The drawbacks are, you have to use Cocoapods 0.39, which is pretty legacy and the hacked version of RestKit is forked of 0.25.0, so it's also not the newest of the new.

To use the fork, in your Podfile, replace pod 'RestKit', ... with pod 'RestKit', :git => 'https://github.com/resmio/RestKit', :tag => 'v0.25.0-use-frameworks'

Also, you might need to use a hacked version of AFNetworking, which also made some problems. Same here, replace pod 'AFNetworking', ... with pod 'AFNetworking', :git => 'https://github.com/resmio/AFNetworking', :tag => 'v1.3.4-use-frameworks'

I'd be glad if you'd let me know if that wrked for you and if so, spread the word! :)

Community
  • 1
  • 1
Jan Nash
  • 1,883
  • 19
  • 30
  • 2
    Hi. Please don't post duplicated answers. If a question already has an answer, *flag the question as duplicate*, it's better. Thanks! – Eric Aya Sep 09 '16 at 10:35
  • Yeah, I guessed so. Though actually the question is not a literal duplicate but imho describes a similar symptom caused by the same problem and being fixable by the same method, so I hesitated marking it as a duplicate. – Jan Nash Sep 09 '16 at 12:31
  • 1
    The question does not have to be the exact same. As long as the *answer* would be identical, flag the question as duplicate. – Eric Aya Sep 09 '16 at 12:32
  • 1
    Woah, you're quick. Ok, doing that. Thanks for the advice. – Jan Nash Sep 09 '16 at 12:33