【cocoapods】たまにしか使わないのですぐにわからなくなる。/(^o^)\ | iPhoneアプリ備忘録
前回↑から引き続きFirebaseのadMobを入れていきます。
参考サイト
iOS 用 Firebase 向け Google アナリティクスを使ってみる | Firebase
スタートガイド | Firebase
ってゆーかよく見直したらSwift3で似たような記事書いてる。/(^o^)\
【Swift3】と【cocoaPods】と【Firebase】と【adMob】 | iPhoneアプリ備忘録
ただこのあとにpodfileの書き方が変わってる。
【CocoaPods】Podfileの書き方が変わっていた。 | iPhoneアプリ備忘録
それらを参考にPodFileを書き換えます。
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
# Uncomment the next line to define a global platform for your project # platform :ios, '9.0' target 'admobFireBaseTest' do # Comment the next line if you're not using Swift and don't want to use dynamic frameworks use_frameworks! pod 'Firebase/Core' pod 'Firebase/AdMob' # Pods for admobFireBaseTest target 'admobFireBaseTestTests' do inherit! :search_paths # Pods for testing end target 'admobFireBaseTestUITests' do inherit! :search_paths # Pods for testing end end |
pod ‘Firebase/Core’
pod ‘Firebase/AdMob’
上記を追加しています。
で、保存したあとターミナルからインストールします。
Podfileのあるディレクトリを間違えないようにね。
で、
1 |
$ pod install |
結果↓
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 |
$ pod install Analyzing dependencies Downloading dependencies Installing Firebase (5.17.0) Installing FirebaseAnalytics (5.6.0) Installing FirebaseCore (5.3.0) Installing FirebaseInstanceID (3.5.0) Installing Google-Mobile-Ads-SDK (7.40.0) Installing GoogleAppMeasurement (5.6.0) Installing GoogleUtilities (5.3.7) Installing nanopb (0.3.901) Generating Pods project Integrating client project [!] Please close any current Xcode sessions and use `admobFireBaseTest.xcworkspace` for this project from now on. Sending stats Pod installation complete! There are 2 dependencies from the Podfile and 8 total pods installed. [!] Automatically assigning platform `ios` with version `12.1` on target `admobFireBaseTest` because no platform was specified. Please specify a platform for this target in your Podfile. See `https://guides.cocoapods.org/syntax/podfile.html#platform`. |
とゆーことでFirebaseとAdMobが入りました。
xcodeでプロジェクトを開くときは、.xcodeprojファイルではなく、
新しく作られた.xcworkspaceファイルを開くことを間違えないようにしましょう。