Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

No such module 'GoogleMobileAds' - Swift 2

In my application, I integrated the GoogleMobileAds framework to add some banners. The problem is that every time I launch my project, I receive the error message No such module 'GoogleMobileAds'. I found a solution but it is not very effective : I remove references for the framework, I created a folder into the folder where all the files are and I put the framework into it. Every time I launch Xcode I need to remove references for the framework and add again the framework from the Framework folder I created and the error message disappear.

Anyone have a solution ?

Thank you !

UPDATE

Solution find with @ethemsulan's answer in : AdMob 7.3.1 and Swift 2.0 - Module not found

like image 567
fredericdnd Avatar asked Nov 07 '15 13:11

fredericdnd


1 Answers

For future reference, I will still answer the question.

There's two steps to solving the Module not found error, which also often occurs with the Parse framework.

  1. Add the path of the framework to your project. You do that by going to the Targets pane. There select Build Settings and then search/select Framework Search Path under Search Paths. There add the GoogleMobileAds.framework path. This could be in your root directory of the project or at an external location, add either one. (If you cannot see it be sure to select All instead of Basic in the upper left corner)
  2. Then disable Bitcode. Bitcode is a new technology introduced by apple in Xcode 7 and iOS 9 which allows to make apps smaller. You can read more about it here. This can often cause problems so your best bet is to disable it in the project. To do this, go to Project -> Build Settings and toggle Enable Bitcode to NO

After this clean the project by selecting CMD-Shift-K or selecting Product -> Clean

Hope that helps, Julian

like image 106
Julian E. Avatar answered Sep 20 '22 11:09

Julian E.