could not build module googlemobileads というエラー

Xcodeを7から8にアップデートして、
環境を2009のmacminiから2016のMacBook Proに移行して、
何が原因だかわからんが、ちょっと前に作ったアプリをエミュレーションで起動しようとしたらエラーが出た。
Objective-cで作ったアプリだ。

エラーメッセージはこんな感じ。
could not build module googlemobileads

どうもGoogleMobileAds.hが見つからん的なエラーが幾つか出る。
ぐぐったところimportの書き方を変えてみる的な記事が出てきたがそれでは治らんかった。

cocoa podでインストールしたものを削除して再インストールしてみたらどーかなとやってみた。

参考サイト
CocoaPodsのアンインストール方法 · Yukim Log

podファイルで
pod ‘Async’
だそうだ。

↓podファイル

# Uncomment the next line to define a global platform for your project
# platform :ios, '9.0'

target ‘アプリ名’ do


pod ‘Async’


  end

end

んでもってターミナルから実行。

ディレクトリは移動しておこうね。ヽ(^。^)ノ

$ pod install
Analyzing dependencies
Downloading dependencies
Using Google (2.0.4)
Using Google-Mobile-Ads-SDK (7.7.1)
Using GoogleAnalytics (3.14.0)
Using GoogleInterchangeUtilities (1.2.0)
Using GoogleNetworkingUtilities (1.2.0)
Using GoogleSymbolUtilities (1.1.0)
Using GoogleUtilities (1.3.0)
Generating Pods project
Integrating client project
Sending stats
Pod installation complete! There are 2 dependencies from the Podfile and 7 total pods installed.

んで、アプリ.xcworkspaceも削除。

再度podファイルを編集

# Uncomment the next line to define a global platform for your project
 platform :ios, '9.0'

target 'アプリ名' do
  # Uncomment the next line if you're using Swift or would like to use dynamic frameworks
   use_frameworks!

pod 'Google-Mobile-Ads-SDK', '~> 7.0'
pod 'Google/Analytics'

  # Pods for アプリ名

  target 'アプリ名Tests' do
    inherit! :search_paths
    # Pods for testing
  end

end

んで、ターミナルから実行。

$ pod install
Analyzing dependencies
Removing Google
Removing Google-Mobile-Ads-SDK
Removing GoogleAnalytics
Removing GoogleInterchangeUtilities
Removing GoogleNetworkingUtilities
Removing GoogleSymbolUtilities
Removing GoogleUtilities
Downloading dependencies
Installing Async (0.2.0)
Generating Pods project
Integrating client project
Sending stats
Pod installation complete! There is 1 dependency from the Podfile and 1 total pod installed.

[!] Your Podfile has had smart quotes sanitised. To avoid issues in the future, you should not use TextEdit for editing it. If you are not using TextEdit, you should turn off smart quotes in your editor of choice.
kurodakouseinoMacBook-Pro:DaimokuCounter kurodakousei$ pod install
Analyzing dependencies
Removing Async
Downloading dependencies
Installing FirebaseAnalytics (3.6.0)
Installing FirebaseCore (3.4.6)
Installing FirebaseInstanceID (1.0.8)
Installing Google (3.0.3)
Installing Google-Mobile-Ads-SDK (7.16.0)
Installing GoogleAnalytics (3.17.0)
Installing GoogleInterchangeUtilities (1.2.2)
Installing GoogleSymbolUtilities (1.1.2)
Installing GoogleToolboxForMac (2.1.0)
Generating Pods project
Integrating client project

[!] Please close any current Xcode sessions and use `DaimokuCounter.xcworkspace` for this project from now on.
Sending stats
Pod installation complete! There are 2 dependencies from the Podfile and 9 total pods installed.

新しく.xcworkspaceファイルも作られて、エラーが消えました。\(^o^)/

コメントを残す

メールアドレスが公開されることはありません。 * が付いている欄は必須項目です