can't build and run in simulator

Hi,

I’ve got no problem building and running my app on devices, but when I try to Build and “Open in XCode iOS Simulator” I get the following error:

Jan 05 02:13:12.200 [iOS Simulator] ERROR: Runtime error
Jan 05 02:13:12.201
Jan 05 02:13:12.205 [iOS Simulator]     ERROR: Could not load provider (admob) due to the following reason: module ‘CoronaProvider.ads.admob’ not found:resource (CoronaProvider.ads.admob.lu) does not exist in archive [iOS Simulator]         no field package.preload[‘CoronaProvider.ads.admob’] [iOS Simulator]         no file ‘/Users/MacKirk/Library/Developer/CoreSimulator/Devices/B4B8EF71-F05E-4CDF-B5A2-2CA4BE889B3D/data/Containers/Bundle/Application/417AD45F-D243-4A50-BD45-88A1AA1DD944/The Best Cricket Game Ever.app/CoronaProvider/ads/admob.lua’ [iOS Simulator]         no file ‘/Users/MacKirk/Library/Developer/CoreSimulator/Devices/B4B8EF71-F05E-4CDF-B5A2-2CA4BE889B3D/data/Containers/Bundle/Application/417AD45F-D243-4A50-BD45-88A1AA1DD944/The Best Cricket Game Ever.app/CoronaProvider/ads/admob.lua’ [iOS Simulator]         no file ‘./CoronaProvider/ads/admob.so’ [iOS Simulator]         no file ‘/Users/MacKirk/Library/Developer/CoreSimulator/Devices/B4B8EF71-F05E-4CDF-B5A2-2CA4BE889B3D/data/Containers/Bundle/Application/417AD45F-D243-4A50-BD45-88A1AA1DD944/The Best Cricket Game Ever.app/CoronaProvider/ads/admob.so’ [iOS Simulator]         no file ‘./CoronaProvider.so’ [iOS Simulator]         no file '/Users/MacKirk/Library/Developer/CoreSimulator/Devices/B4B8EF71-F05E-4CDF-B5A2-2CA4BE889B3D/data/Containers/Bundle/Application/417AD45F-D243-4A50-BD45-88A1AA1DD944/The Best Cricket Game Ever.app/CoronaProvider.so’CoronaProvider.ads.admob. [iOS Simulator]     stack traceback: [iOS Simulator]         [C]: in function ‘assert’
Jan 05 02:13:12.206 [iOS Simulator]         ?: in function ‘requireProvider’ [iOS Simulator]         ?: in function ‘setCurrentProvider’ [iOS Simulator]         ?: in function ‘init’ [iOS Simulator]         scripts/advertising.lua:57: in main chunk [iOS Simulator]         [C]: in function ‘require’ [iOS Simulator]         ?: in function ‘require’

Here is my build.settings:

settings =
{

    iphone = {
        plist = {

             CFBundleIconFiles = {
            “Icon.png”,
            “Icon@2x.png”,
            “Icon-Small-40.png”,
            “Icon-Small-40@2x.png”,
            “Icon-60.png”,
            “Icon-60@2x.png”,
            “Icon-72.png”,
            “Icon-72@2x.png”,
            “Icon-76.png”,
            “Icon-76@2x.png”,
            “Icon-Small-50.png”,
            “Icon-Small-50@2x.png”,
            “Icon-Small.png”,
            “Icon-Small@2x.png”
            },
        
            UIApplicationExitsOnSuspend = false,

            FacebookAppID = “xxx”,  --replace XXXXXXXXXX with your Facebook App ID

            CFBundleURLTypes = {
                {
                CFBundleURLSchemes = { “xxx”, }  --replace XXXXXXXXXX with your Facebook App ID
                }
            },
            – Whitelist Facebook apps
            LSApplicationQueriesSchemes =
            {
                “fb”,  – Needed for the facebook-v4.isFacebookAppEnabled() API
                “fbapi”,
                “fbauth2”,
                “fb-messenger-api”,
                “fbshareextension”
            },            
            [“URL types”] = {
                item = {
                    [“URL Schemes”] =
                        { [“Item 0”] = “xxx” },  --replace XXXXXXXXXX with your Facebook App ID
                },
            },            
        }
    },
    
    android =
    {
        versionCode = “125”,
        installLocation=“preferExternal”,
        facebookAppId = “xxx”,  --replace XXXXXXXXXX with your Facebook App ID
        
    },

    androidPermissions =
    {
       “android.permission.READ_PHONE_STATE”,
       “android.permission.ACCESS_NETWORK_STATE”,
       “android.permission.VIBRATE”,
       “android.permission.INTERNET”,
        “android.permission.ACCESS_WIFI_STATE”,    
        “android.permission.ACCESS_FINE_LOCATION”,
        “android.permission.ACCESS_COARSE_LOCATION”,
        “com.android.vending.CHECK_LICENSE”,
        “com.android.vending.BILLING”,
        },

    plugins =
    {
      --key is the name passed to Lua’s ‘require()’
     [“CoronaProvider.native.popup.social”] =
      {
        --required
        publisherId = “com.coronalabs”, – don’t change, is’t the publisher of the plugin
      },
      

– key is the name passed to Lua’s ‘require()’
        [“plugin.google.iap.v3”] =
        {
            – required
           publisherId = “com.coronalabs”,
            supportedPlatforms = { android = true },
        },

        – includes IAP Badger as a plug in
        [“plugin.iap_badger”] =
        {
            – required
            publisherId = “uk.co.happymongoose”,
        },
        
        [“plugin.facebook.v4”] =
        {
            publisherId = “com.coronalabs”,
            supportedPlatforms = { iphone=true, [“iphone-sim”]=true, android=true, [“android-kindle”]=true },
        },

        – key is the name passed to Lua’s ‘require()’
        [“plugin.google.play.services”] =
        {
            – required
            publisherId = “com.coronalabs”, – don’t change, it’s the publisher of the plugin
            supportedPlatforms = { iphone=true, android=true }            
        },
        
        – key is the name passed to Lua’s ‘require()’
     –   [“CoronaProvider.ads.vungle”] =
      –  {
            – required
        –    publisherId = “com.vungle”,
        --},
        
    },

  orientation =
    {
        default = “portrait”,
        supported =
        {
        “portrait”,
        “portraitUpsideDown”,
        },
                    
    },
    

}

thx!
  

What version of Corona are you building with?
 

Are you using AdMob ads?

Rob

Hi Rob,

Version 2016.2992 (2016.11.10)

Yes Im using admob

thx

The iOS Simulator requires a different plugin since it’s running on an X86 processor instead of the ARMv7 processors that mobile devices use. When we make plugins we make a iOS Xcode simulator specific version of plugins.

You’re not including it here:

        [“plugin.google.play.services”] =
        {
            – required
            publisherId = “com.coronalabs”, – don’t change, it’s the publisher of the plugin
            supportedPlatforms = { iphone=true, android=true }             
        },

You are saying "only load the plugin for iOS and Android.  You have two choices:

  1. Remove that line. That way we will load the plugin on any device you build for. If it’s unsupported, you will get a stub plugin that basically makes all the functions not do anything, but the app will work because the plugin isn’t erroring.

  2. Update supportedPlatforms to include the iOS Simulator:

        [“plugin.google.play.services”] =
        {
            – required
            publisherId = “com.coronalabs”, – don’t change, it’s the publisher of the plugin
            supportedPlatforms = { iphone=true, android=true,[“iphone-sim”] = true  }            
        },

Rob

What version of Corona are you building with?
 

Are you using AdMob ads?

Rob

Hi Rob,

Version 2016.2992 (2016.11.10)

Yes Im using admob

thx

The iOS Simulator requires a different plugin since it’s running on an X86 processor instead of the ARMv7 processors that mobile devices use. When we make plugins we make a iOS Xcode simulator specific version of plugins.

You’re not including it here:

        [“plugin.google.play.services”] =
        {
            – required
            publisherId = “com.coronalabs”, – don’t change, it’s the publisher of the plugin
            supportedPlatforms = { iphone=true, android=true }             
        },

You are saying "only load the plugin for iOS and Android.  You have two choices:

  1. Remove that line. That way we will load the plugin on any device you build for. If it’s unsupported, you will get a stub plugin that basically makes all the functions not do anything, but the app will work because the plugin isn’t erroring.

  2. Update supportedPlatforms to include the iOS Simulator:

        [“plugin.google.play.services”] =
        {
            – required
            publisherId = “com.coronalabs”, – don’t change, it’s the publisher of the plugin
            supportedPlatforms = { iphone=true, android=true,[“iphone-sim”] = true  }            
        },

Rob