google / gtm-oauth2

Google Toolbox for Mac - OAuth 2 Controllers
Apache License 2.0
125 stars 70 forks source link

Classes not recognized by the XCode #62

Closed eraydiler closed 8 years ago

eraydiler commented 8 years ago

Hi,

I included the library using pod 'GTMOAuth2' but unable to use it because XCode does not recognize the classes in it. I also tried to include the library manually, and i got the same result, got not found error when i tried to use one of classes of the library.

I have XCode7.3, and cocoapods 1.0.0.beta.4.

Pods screen shot 2016-03-30 at 12 56 01

Import screen shot 2016-03-30 at 12 56 47

When i want to use library screen shot 2016-03-30 at 12 59 04

thomasvl commented 8 years ago

Do you use use_frameworks! in from pod file?

@perotinus any ideas?

eraydiler commented 8 years ago

I even tried to add library by following; https://github.com/google/google-api-objectivec-client/wiki/BuildingTheLibrary Linking to the Framework (iOS or OS X) section. And still getting the same error :cry:

thomasvl commented 8 years ago

That framework has a different name, so the prefix on the import will be different (GTL/GTMOAuth2ViewControllerTouch.h)

My previous question still hold, how were you setting up your pod file, do you use use_frameworks! or not?

eraydiler commented 8 years ago

My import is #include <GTL/GTMOAuth2ViewControllerTouch.h> right now. I removed the library from podfile and tried to include the GTL.framework mentioned in the link i shared above. So i don't have any pod right now. But yes i also had tried including use_frameworks! before, which didn't worked neither.

thomasvl commented 8 years ago

And when you switched to the Xcode project reference, you are depending on the iOS framework, not the OS X one?

If you go look at the built GTL.framework, what headers are there?

eraydiler commented 8 years ago

The headers are like this screen shot 2016-03-30 at 17 02 39

I could't understand your first question, the project i want to use the library with is a iOS project if you meant that.

Can this be related to some configuration flags?

thomasvl commented 8 years ago

Re first question: The GTLCore project has a framework for OS X and a framework for iOS. I just was confirming you were depending on the iOS one. If you had accidentally depended on the OS X one, then I wouldn't expect the framework to include the GTMOAuth2ViewControllerTouch header.

It is some configuration in your project, I'm just not sure what. We haven't had any other reports like this and there are other folks with things working.

eraydiler commented 8 years ago

The problem was the flags belong to old library (https://github.com/google/gdata-objectivec-client) which i removed from project before. After removing the; "-DGDATA_REQUIRE_SERVICE_INCLUDES=1", "-DGDATA_INCLUDE_CALENDAR_SERVICE=1", build suceeded.

thomasvl commented 8 years ago

Glad you got it sorted out!