Closed foffux closed 9 years ago
Not a problem with Xcode 5, but you probably created the project in Xcode 4 and so the project didn't have modules enabled by default.
It's an easy fix. Simply go to your project's build settings, search for "modules", you should see a setting "Enable Modules (C and Objective-C)" - change this to Yes. You should be able to compile then.
EDIT: Just noticed your screenshot this is only appearing on the GoogleMobileAdsSdk line, so this setting maybe already set to Yes. Might want to check your project's Framework Search Paths are set correctly, it might not be finding the AdMob SDK.
Hello Thanks for the answer but I guess this is not the issue. I created the project with Xcode 5 and so I have already this setting enabled, as you can see from the screen shot below. Other suggestion?
Sorry I edited my comment above after looking at your first screenshot more closely. Seems like it's not finding the Google AdMob SDK. I see you're using Pods, so it's strange you get this error as it should handle this all automatically.
Check your project's Framework Search Paths? Should have an entry like $(PODS_ROOT)/Google-Mobile-Ads-SDK
set to recursive
Are you meaning this? If you did, I guess I have. But also changing to recursive does not help, as you can see. Sorry I have to leave my job place now, I will check your answer as soon as possible, hoping you can help me. Thank you.
Yes I see something similar in mine. But mine also has $(PODS_ROOT)/Google-Mobile-Ads-SDK
so try adding that and make sure it's set to recursive. pod install should have added it automatically though.
Hi Chris. Sorry for annoying you but I am not able to let my project run with it. I tried what you tad me, but nothing, I tried to perform a cleaning reinstall, but nothing. Here you are what I can see. I cannot understand why it does not work...
I tried to import just google ads framework but nothing I got the following issue. I cannot understand:
This is very strange. I honestly don't know why this is happening, especially with CocoaPods. I created a new test project just now and it can build fine with CJPAdController and the AdMob SDK.
My only other thought is maybe you have an old version of cocoapods which isn't handling it correctly? You could try running sudo gem install cocoapods
to update, and then try installing your pods again in a new project?
Or maybe it is a problem with Xcode 5... I'm not sure, I can't test that as I only have Xcode 6 available now.
Hi Exactly same issue with a new test project and only this pod added. I also updated my cocoapods, but my version was already: pod --version 0.35.0 so the latest one. The last chance is to update to Xcode 6...I had to do it but I would have been able to understand why this issue happened. Anyway, I try with Xcode 6 and I hope...
Hi. I did it! I had to update to Xcode 6 and also add -Objc instead of -ObjC in OTHER LINKER FLAGS I do not actually the reason but it works for me now. Thank you.
Glad to hear you fixed it!
The new AdMob framework (v7.0.0) shouldn't require that -ObjC flag though, so I'm thinking you have an old version, probably 6.12? Well, I guess if it all works then it doesn't matter now :)
I do not think so because in xcconfig I can see:
PODS_GOOGLE_MOBILE_ADS_SDK_FRAMEWORK_SEARCH_PATHS = "$(PODS_ROOT)/Google-Mobile-Ads-SDK/GoogleMobileAdsSdkiOS-7.0.0" PODS_GOOGLE_MOBILE_ADS_SDK_OTHER_LDFLAGS = -framework "AVFoundation" -framework "AudioToolbox" -framework "CoreGraphics" -framework "CoreTelephony" -framework "EventKit" -framework "EventKitUI" -framework "GoogleMobileAds" -framework "MessageUI" -framework "StoreKit" -framework "SystemConfiguration" -weak_framework "AdSupport"
So I think my version is the latest one. Do you know how I can check for sure? Thank you.
Oh, yes that's definitely the latest version, it wouldn't have created that directory otherwise. It's possible you require -ObjC for some other pods you have though. Google said in the v7.0.0 release notes - "Removed dependency on the -ObjC linker flag."
As for explicitly checking the version I believe there is a constant GoogleMobileAdsVersionString
and also [GADRequest sdkVersion]
method that should return version strings.
So it's a little weird you had problems getting this to work, but if everything is working fine now then hopefully you should be good to go. Good luck with your project.
I finally guess to have understood how to run your pod correctly. I followed this:
Now, I am using your controller. And I have a question you sure can answer. Running also your sample project I cannot see mediation at work. That is: if [CJPAdController sharedInstance].adNetworks = @[@(CJPAdNetworkiAd), @(CJPAdNetworkAdMob)]; then only iAd can be seen instead if [CJPAdController sharedInstance].adNetworks = @[@(CJPAdNetworkAdMob), @(CJPAdNetworkiAd)]; then only AdMob can be seen
This happens both in iOS 7 and iOS 8. I sure with an older version of your controller, I was able to see both, mediated.
Are you trying to check, please? Thank you very much.
Sorry. I was wrong. Everything works well, just I had to wait for enough time...sorry.
It is a very long long time, anyway...When all of two are setup, in fact almost only one is shown. Are you aware of this?
Yes. That is actually the way this is supposed to work. It's not technically 'mediation'.
Basically, you choose which ad network you prefer and it will show this all the time. But, if it doesn't get an ad, it will try the other network instead, and it will keep using that until it can get an ad from the network you prefer.
Ahhh...sorry. I did not get this. I have not read carefully. Ok, I now get this. Then it works well :-)
This issue can be close for me, but please take a look also at Status bar and Banner on top #23 Thank you.
I am trying to use CJPAdController under Xcode 5.1.1 but I got the following compilation error. I am wondering if it is due to Xcode 5 or not. If not, please help me solving this issue. Thank you.