gonzalezreal / Groot

From JSON to Core Data and back.
Other
534 stars 61 forks source link

Groot fails to build under Xcode 7.1 #55

Closed o15a3d4l11s2 closed 9 years ago

o15a3d4l11s2 commented 9 years ago

Building Groot fails under Xcode 7.1 with the error

Include of non-modular header inside framework module 'Groot.Groot'

The cause of the issue is the way headers are included in Groot.h file:

#import <Groot/GRTError.h>
#import <Groot/GRTManagedStore.h>
#import <Groot/NSValueTransformer+Groot.h>
#import <Groot/GRTJSONSerialization.h>

Changing the includes to

#import "GRTError.h"
#import "GRTManagedStore.h"
#import "NSValueTransformer+Groot.h"
#import "GRTJSONSerialization.h"

fixes the issue.

gonzalezreal commented 9 years ago

Hi @o15a3d4l11s2 Using the angle brackets in the umbrella header its the correct way. Are you getting this error when using Cocoapods? Maybe it is related with CocoaPods/CocoaPods#4420.

soulchild commented 9 years ago

Did you actually find a fix for this? Reading through the vast amount of comments on various Cocoapods projects where users are having this issue I'm confused as to whether this is something that needs fixing in Cocoapods, Groot or if we just have to wait for Xcode 7.2.

o15a3d4l11s2 commented 9 years ago

I think that this issue is related to CocoaPods, since the issue that @gonzalezreal pointed to is still open.

Since I was not able to resolve it easily, I had to do something not so nice - manually changing the #import statements (see my previous comment). Please be aware that this is not a solution of the problem - modifying the content of the file manually inside the pod means that this change should be made on every machine, where the project lives and that the changes will be lost once you install a newer version of the pod through pod update.

A better approach would be forking the Groot project and changing the imports there, then installing your forked version of the pod.

gregkerzhner commented 9 years ago

+1 on creating a forked version, also broken for me.

gonzalezreal commented 9 years ago

You can use a post_install in your Podfile that replaces the angle brackets as suggested here: https://github.com/CocoaPods/CocoaPods/issues/4420#issuecomment-150668304

ManueGE commented 8 years ago

Yep, I fixed it by adding:

post_install do |installer|
    `find Pods -regex 'Pods/Groot.*\\.h' -print0 | xargs -0 sed -i '' 's/\\(<\\)Groot\\/\\(.*\\)\\(>\\)/\\"\\2\\"/'`
end

at the end of my podfile

kikolobo commented 8 years ago

Hi All..

I see that the issue is now closed on cocoapods repo. issue 4420 and marked as fixed.

The workaround still works, but I am wondering if this is still an issue with cocoaPods or groot since no other library I import from pods complaints. Any idea?

gonzalezreal commented 8 years ago

The fix should be available in Cocoapods 1.0.0 beta. If you can still reproduce it with that Cocoapods version, please let me know.

kikolobo commented 8 years ago

Thanks @gonzalezreal .. Great Work!