Recently I tried to update admob SDK(iOS) to the latest version(7.0.0)
I have trouble importing the framework.
It keeps giving me this error "GoogleMobileAds/GoogleMobileAds.h" file not found
I removed the old admob sdk and imported the framework manually.
I've tried
No luck, any ideas to solve this? thanks.
After several tries, I've finally managed to build my app (from a Unity project). It took several steps from different answers here, so I'm posting the detailed steps of what I did. (I also want to practice formatting skills here in SO. lol)
Overview: The goal is to install admob cocoapod then set the FrameWork paths. Yes, these have already been mentioned above but they come from different answers which was a bit confusing for me.
Steps:
Close Xcode if you have it running.
Open a Terminal window and enter the following:
sudo gem install cocoapods
This will install cocoapods
In the same Terminal, cd to your Xcode project directory:
cd Documents/MyGitHub/MyNiceApp
Enter the following:
pod init
This will create a pod file in the project directory
Open the pod file in a text editor and do the following:
pod 'Google-Mobile-Ads-SDK', '7.26.0'
pod 'Google-Mobile-Ads-SDK'
# Uncomment the next line to define a global platform for your project
platform :ios, '9.0'
target 'MyNiceApp-iPhone' do
# Comment the next line if you don't want to use dynamic frameworks
use_frameworks!
# Pods for MyNiceApp-iPhone
pod 'Google-Mobile-Ads-SDK', '7.26.0'
target 'MyNiceApp-iPhone Tests' do
inherit! :search_paths
# Pods for testing
end
end
Back in the Terminal window where you cd'ed to your Xcode project, enter the following:
pod install --repo-update
This will install the admob framework and save it in your Xcode project directory
Open Xcode with your project or workspace
In Project Explorer, look for Pods > ... > GoogleMobileAds.framework
Copy the Full Path from the properties, it would look something like this:
/Users/mickeymicks/Documents/MyGitHub/MyNiceApp/Pods/Google-Mobile-Ads-SDK/Frameworks/frameworks/GoogleMobileAds.framework
Note: the path contains the "GoogleMobileAds.framework" at the end
Open Build Settings for your TARGETS
Look for Framework Search Paths, double-click then add a new row for it.
Paste the path you just copied.
Clean the project then Build.
I recently had the same error. It was fixed really easy: I needed to open the .xcworkspace
file instead of .xcodeproj
.
Also did install pods beforehand but not sure if it contributes to the solution :)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With