Quick Links: Download Gideros Studio | Gideros Documentation | Gideros Development Center | Gideros community chat | DONATE
[Solved] Error in xCode: module 'ads' not found: — Gideros Forum

[Solved] Error in xCode: module 'ads' not found:

Tom2012Tom2012 Guru
edited October 2015 in General questions
I managed to get my app built on xCode once but I'm buggered if I can remember how. :)

When I try to get Ads Interface running in the project, I get:
main.lua:7: module 'ads' not found:
Line 7 in my main.lua is
require "ads"
Here's the steps I am taking:

1) Export project from Gideros as iOS
2) Open in xCode
3) Download the Gideros plugins
4) Copy /Ads/Source/iOS/Plugins/Ads/ to my exported project /Plugins folder
(minus the files admob does not need)
5) In xCode, add the same files into the project's plugin folder
6) Add the -ObjC linker
7) Add the required frameworks

I've also got the following in my build settings:

- set bitcode to NO
- Enable modules
- Link Frameworks Automatically ... are set to ‘yes’
- other linker flags: set to -ObjC
- Set Defines Module to Yes
- Set the header and library paths to recursive

Why do I get this weird error?

Thanks

Comments

  • Here's a screenshot of my project folder - I think I've got the Ads/ folder in the right place?
    screenshot_250.jpg
    264 x 1177 - 76K
  • If you only use admob. You can use pod to install plugin. Just copy ad files to plugin folder(minus admob files) No other configuration needed. That works like a charm
  • @mehmetuysal - thanks for that. I'm looking into pod on google.

    I've also solved my problem.

    I found out what I was doing wrong. It was to do with the way I was adding the files into the project, within xCode. For anyone else with this error...

    You must use the ‘create groups’ option, not create folder references (the folder must be yellow, not blue)! Not sure what the difference is, but this fixes the error.
  • Dear Tom
    Can Yo Please Make Step By Step Procedure For Adding Admob To XCode , I Face The Same Problem
    Thanks
  • Tom2012Tom2012 Guru
    edited October 2015
    Hi @LuayAfaneh1973

    Of course!

    I'll assume you've added the code into your project that makes the ads show, but please let me know if you're having problems with this bit, as I can help on that as well.

    1) You'll also need to download the plugins (I'm sure you've got this bit) from https://github.com/gideros/giderosplugins - extract the zip into a folder somewhere easy to get to.

    2) Export your Gideros project, choosing iOS

    3) Once that's done, we need to get the plugin in the right place. This bit is tricky.

    i) In the downloaded plugins, go to this folder...

    giderosplugins-master/Ads/source/iOS/Plugins

    ii) In another Finder / Explorer window, double click into your Gideros exported project folder that we just created. Navigate to the folder that has your assets folder and plugins folder and go into your plugins folder.

    iii) Copy the /Ads/ folder from the plugins we downloaded into your plugins folder in your xcode project.

    You should now have

    Exported project folder/Plugins/Ads

    4) Open up xCode and open your exported project.

    5) Click on the project name in the top left of the screen. It will be your game name. This will bring up a panel on the right of the screen.

    6) Click on Build Settings and lets do some work here.

    Here's the settings you'll need to change here:

    - set bitcode to NO
    - Enable modules Yes
    - Check Link Frameworks Automatically ... are set to ‘yes’
    - other linker flags: set to -ObjC
    - Set Defines Module to Yes

    7) Now lets add the plugins files into xCode. This one can really be tricky too.

    i) Click the down arrow next to your game name in the top left.

    ii) Expand once more so that you can see folders and other project files. You should see folders assets/ Plugins/ and Supporting files/ folders

    iii) Right click on Plugins and click 'Add Files to [your project name]

    iv) Navigate to your exported project folder, not the downloaded plugins folder.

    v) Go into plugins and click on the Ads folder.

    vi) Here's the bit you have to get right...

    Click Options and you must use the ‘create groups’ option, not create folder references

    In xCode now, we should have Plugins/Ads and the Ads folder NEEDS TO BE YELLOW. If it's blue, delete it (choose delete references, not move to trash) and add it again, using create groups.

    The ads plugin should be in place now.

    8) Nearly done! Now lets add the Libraries that we need here.

    On the right of the screen, click on the build phases tab, then expand the Link Binary With Libraries. Under the list of Libraries, click on the + symbol.

    9) Add these libraries in

    AdSupport
    AudioToolbox
    AVFoundation
    CoreGraphics
    CoreTelephony
    EventKit
    EventKitUI
    MessageUI
    StoreKit
    SystemConfiguration

    Save time by copying their name into the library search box and double clicking them to add them. By searching for their name and double clicking to add them.

    That should be it. I've just run through this on xCode while I was typing it up. So let me know if you hit any errors. It could be I've got them before.
  • Thank You Very Much For Your Response , After Implementing All Steps Above Error Appear To Me : umbrella header 'googlemobileads.h' not found in "module.modulemap"
  • Sometimes some problems are solved by closing and reopening Xcode project.
  • dear yubaro
    I try this problem still there
  • Hi @LuayAfaneh1973

    What version of xCode are you using?

    One thing that might help...

    1) Go to Builld Settings again

    2) Look under 'Search Paths'

    3) Look for:

    Header Search Paths
    Library Search Paths
    Framework Search Paths

    4) For each of these, double click on the path (on the right side) and try setting the paths to recursive rather than non-recursive.

    This can help xCode get to the library.

    Hope this helps!

    Tom




  • Also, is googlemobileads.h in the right place?

    Expand the folders out and check it looks like this (below)

    :)
    screenshot_251.jpg
    522 x 1047 - 95K
  • Dear Tom
    Thank You Very Much For Your Help , Work For Me Now , I Use XCode 7 , When I put "Ads" Folder Which I Download It From Site Mentioned Problem Appear Also No Folder Appear Under "googlemobileads.framwork" So I Downloaded It From Google "Admob" Site And Work Like Charm.
    Thank U
  • Glay you fixed it LuayAfaneh1973! :)>-
Sign In or Register to comment.