[build .2799] Problem with iCloud KVS, getting error "module 'plugin_iCloud' not found"

Hi,

just started to add iCloud KVS, I set up my provisioning profiles and made the required changes to the build.settings, e.g.:

tvos = { iCloud = true, }

and 

plugins = { ["plugin.iCloud"] = { publisherId = "com.coronalabs", supportedPlatforms = { iphone=true, appletvos=true, ["iphone-sim"]=true }, }, },

In my code I added the plugin using:

local iCloud = require("plugin.iCloud") 

When I compile my game I get an error:

ERROR: [Lua] Runtime error

module ‘plugin_iCloud’ not found:

no field package.preload[‘plugin_iCloud’]

no file ‘/Users/andreas/Library/Application Support/Corona/Simulator/Plugins/plugin_iCloud.lua’

no file ‘/Users/andreas/Desktop/Corona/Projects/Freeze-2-tvOS/plugin_iCloud.lua’

no file ‘/Applications/CoronaSDK/Corona Simulator.app/Contents/Resources/plugin_iCloud.lua’

no file ‘/Users/andreas/Library/Application Support/Corona/Simulator/Plugins/plugin_iCloud.dylib’

no file ‘./plugin_iCloud.dylib’

no file ‘/Applications/CoronaSDK/Corona Simulator.app/Contents/Resources/plugin_iCloud.dylib’

stack traceback:

[C]: in function ‘require’

?: in function ‘require’

/Users/andreas/Desktop/Corona/Projects/Freeze-2-tvOS/main.lua:96: in main chunk

2015-12-25 00:54:23.726 Corona Simulator[1769:71164] Corona Simulator: Goodbye

Best

Andreas

BTW, I did download the free BETA iCloud plugin via the provided link in the tutorial:

https://coronalabs.com/blog/2015/12/18/tutorial-implementing-icloud-key-value-storage/ 

And then I activated it, it is shown as “Activated” on the plugin store.

But still the “module ‘plugin_iCloud’ not found” error shows up.

It can take a few hours after you active the plugin before the build server sees it.

Rob

Hi Rob,

I’m back at my Mac, and I tested again, but no luck.

The plugin is shown as “Activated” on the plugin page, but still it is not found when I compile the game:

==========================================================

Copyright © 2009-2015  C o r o n a   L a b s   I n c .

Version: 3.0.0

Build: 2015.2799

Platform: iPhone / x86_64 / 10.10.5 / Intel HD Graphics 4000 OpenGL Engine / 2.1 INTEL-10.6.33 / 2015.2799 / de | DE | de_DE | de

Loading project from:   ~/Desktop/Corona/Projects/Freeze-2-tvOS

Project sandbox folder: ~/Library/Application Support/Corona Simulator/Freeze-2-tvOS-23CC5F1A02521671B8624F0CD460F915

WARNING: Disabling the idle timer reduces battery life on the device. Also, there is no timer on the simulator

WARNING: Simulator does not support multitouch events

ERROR: [Lua] Runtime error

module ‘plugin_iCloud’ not found:

no field package.preload[‘plugin_iCloud’]

no file ‘/Users/andreas/Library/Application Support/Corona/Simulator/Plugins/plugin_iCloud.lua’

no file ‘/Users/andreas/Desktop/Corona/Projects/Freeze-2-tvOS/plugin_iCloud.lua’

no file ‘/Applications/CoronaSDK/Corona Simulator.app/Contents/Resources/plugin_iCloud.lua’

no file ‘/Users/andreas/Library/Application Support/Corona/Simulator/Plugins/plugin_iCloud.dylib’

no file ‘./plugin_iCloud.dylib’

no file ‘/Applications/CoronaSDK/Corona Simulator.app/Contents/Resources/plugin_iCloud.dylib’

stack traceback:

[C]: in function ‘require’

?: in function ‘require’

/Users/andreas/Desktop/Corona/Projects/Freeze-2-tvOS/main.lua:96: in main chunk

2015-12-29 22:51:37.856 Corona Simulator[784:25596] Corona Simulator: Goodbye

==========================================================

Thanks & best

Andreas

Are you doing an SDK build or an Enterprise build?

ROb

“Normal” SDK, not Enterprise.

Best
Andreas

There are four reasons for this.

  1. You have not activated the plugin at https://store.coronalabs.com (and make sure Corona SDK is using the same email address that yo used to activate the plugin)

  2. You have not included it in build.settings.

  3. You included it in build.settings but there is an error (which should be flagged by Corona!)

  4. You didn’t include it in the module where you’re trying to access it.

But I would have expected you to have checked all of those things already. Can you verify all of those?

Hi Rob;

I am having an identical problem. As I only “activated” the plugin yesterday morning, I figured that  I would wait until this morning for a more complete test (although I got this error yesterday in my quick tests). Here is the status this morning:

– Build 2799
– Xcode 7.2
– build.settings entries exactly per documents
– Simply invoking this command in main.lua ( [lua] local iCloud = require( “plugin.iCloud”) [/lua] ) does this in these environments:

CORONA SIMULATOR - Throws fatal error and halts running (exact error syntax Andreas described). I know that I could deal with this easily with an environment test of whether it is the “simulator”. But your other plugins are elegant because they fail relatively quietly on the simulator if they are only for devices (i.e. iAds).

XCODE iOS SIMULATOR - Throws fatal Runtime Error (exact error syntax Andreas described).

ON DEVICE (iPad 3) - I was pleasantly surprised to see it run (at least not fail in any obvious manner) when I built and loaded the app on an actual device.

Hope this info is helpful. Know it is in Beta and it is a great addition to the product.

Happy New Year.

Steve

Can you post your build.settings?

Here it is:

[lua]

– build.settings

– Apple iOS - Advertising Plug-ins

– NEW Requirement for Facebook Plug-in in iOS for builds #2165 and higher

– New Requirement for Notifications Plugin #2542 and higher

settings = {

orientation = {

default = “portrait”, 

content = “portrait”,

supported = { “portrait”},

},

plugins =

{

– key is the name passed to Lua’s ‘require()’

[“plugin.iCloud”] =

{

publisherId = “com.coronalabs”,

supportedPlatforms = {iphone = true,[“iphone-sim”] = true  },

},

[“plugin.facebook.v4”] =

   {

    publisherId = “com.coronalabs”,

},

[“plugin.notifications”] =

{

   publisherId = “com.coronalabs”,

},

[“CoronaProvider.analytics.flurry”] =

{

   publisherId = “com.coronalabs”,

},

[“CoronaProvider.gameNetwork.apple”] =

{

   publisherId = “com.coronalabs”,

   supportedPlatforms = { iphone=true, [“iphone-sim”]=true },

},

[“CoronaProvider.ads.iads”] =

{

   publisherId = “com.coronalabs”,

},

[“plugin.google.play.services”] =

{

   – required, this is actually needed for AdMob V2 ads, also needed for vungle on Android

   publisherId = “com.coronalabs”,

},

[“CoronaProvider.ads.vungle”] =

{

   publisherId = “com.vungle”,

},

[“plugin.chartboost”] =

   {

           publisherId = “com.swipeware”

       },

},

iphone = {

iCloud = true,

plist = { 

– NEW App Requirement August 2014 for CFBundleShortVersionString - Match the version build in Corona

CFBundleShortVersionString = “1.80”,

   CFBundleIdentifier = “XXXXXXXXXXXXXXX”, 

   CFBundleDisplayName = “Just Jumble”,

UILaunchStoryboardName = “LaunchScreen”,

   UIInterfaceOrientation = “UIInterfaceOrientationPortrait”,

   UISupportedInterfaceOrientations = {“UIInterfaceOrientationPortrait”, “UIInterfaceOrientationPortraitUpsideDown”},

UIStatusBarHidden = true,

UIPrerenderedIcon = true,

UIApplicationExitsOnSuspend = false,

FacebookAppID = “XXXXXXXXXX1087”,

CFBundleURLTypes = {

                { CFBundleURLSchemes = {“fbXXXXXXXXX1087”, }  }

            },

UIAppFonts = {

“FranklinGothic-Demi.ttf”, “FranklinGothic-DemiItalic.ttf”,

},

–icon image files table

CFBundleIconFiles = {

“Icon.png”,

“Icon@2x.png”,

“Icon-60.png”,

“Icon-60@2x.png”,

“Icon-60@3x.png”,

“Icon-72.png”,

“Icon-72@2x.png”,

“Icon-76.png”,

“Icon-76@2x.png”,

“Icon-Small-40.png”,

“Icon-Small-40@2x.png”,

“Icon-Small-40@3x.png”,

“Icon-Small-50.png”,

“Icon-Small-50@2x.png”,

“Icon-Small.png”,

“Icon-Small@2x.png”,

“Icon-Small@3x.png”,

},

–launch image files table

UILaunchImages = {

                {  – iPhone 4 Portrait

                    [“UILaunchImageMinimumOSVersion”] = “6.0”,

                    [“UILaunchImageName”] = “Default”,

                    [“UILaunchImageOrientation”] = “Portrait”,

                    [“UILaunchImageSize”] = “{320,480}”

                },

                {  – iPhone 5 Portrait

                    [“UILaunchImageMinimumOSVersion”] = “6.0”,

                    [“UILaunchImageName”] = “Default-568h”,

                    [“UILaunchImageOrientation”] = “Portrait”,

                    [“UILaunchImageSize”] = “{320,568}”

                },

{  – iPhone 6 Portrait

                    [“UILaunchImageMinimumOSVersion”] = “8.0”,

                    [“UILaunchImageName”] = “Default-667h”,

                    [“UILaunchImageOrientation”] = “Portrait”,

                    [“UILaunchImageSize”] = “{375,667}”

                },

                {  – iPhone 6 Plus Portrait

                    [“UILaunchImageMinimumOSVersion”] = “8.0”,

                    [“UILaunchImageName”] = “Default-736h”,

                    [“UILaunchImageOrientation”] = “Portrait”,

                    [“UILaunchImageSize”] = “{414,736}”

                },

                {  – iPad Portrait

                    [“UILaunchImageMinimumOSVersion”] = “6.0”,

                    [“UILaunchImageName”] = “Default-Portrait”,

                    [“UILaunchImageOrientation”] = “Portrait”,

                    [“UILaunchImageSize”] = “{768,1024}”

                },

                

            },

– Whitelist Facebook Servers for Network Requests (for Facebook and iOS 9 to run together)

            NSAppTransportSecurity = 

            {

                NSExceptionDomains = 

                {

                    [“fbcdn.net”] = 

                    {

                        NSIncludesSubdomains = true,

                        NSExceptionRequiresForwardSecrecy = false,

                    },

                    [“facebook.com”] = 

                    {

                        NSIncludesSubdomains = true,

                        NSExceptionRequiresForwardSecrecy = false,

                    },

                    [“akamaihd.net”] = 

                    {

                        NSIncludesSubdomains = true,

                        NSExceptionRequiresForwardSecrecy = false,

                    },

                },

            },

            – Whitelist Facebook Apps (for Facebook and iOS 9 to run together)

            LSApplicationQueriesSchemes = 

            {

                “fb”,

                “fbapi20130214”,

                “fbapi20130410”,

                “fbapi20140410”,

                “fbapi20140116”,

                “fbapi20150313”,

                “fbapi20150629”,

                “fbauth”,

                “fbauth2”,

                “fb-messenger-api20140430”,

            },

}

},

}

[/lua]

Try commenting out the supported platforms line at least temporarily. This will let the simulator download the stub that it needs to avoid the simulator error.

Rob

[quote name=“Rob Miracle” post=“315458” timestamp=“1451516780”]There are four reasons for this.   1. You have not activated the plugin at https://store.coronalabs.com (and make sure Corona SDK is using the same email address that yo used to activate the plugin) 2. You have not included it in build.settings. 3. You included it in build.settings but there is an error (which should be flagged by Corona!) 4. You didn’t include it in the module where you’re trying to access it.   But I would have expected you to have checked all of those things already. Can you verify all of those?[/quote] Hi Rob, Yes, I did set up everything correctly and double- and triple-checked it. Best Andreas

BTW, I did download the free BETA iCloud plugin via the provided link in the tutorial:

https://coronalabs.com/blog/2015/12/18/tutorial-implementing-icloud-key-value-storage/ 

And then I activated it, it is shown as “Activated” on the plugin store.

But still the “module ‘plugin_iCloud’ not found” error shows up.

It can take a few hours after you active the plugin before the build server sees it.

Rob

Hi Rob,

I’m back at my Mac, and I tested again, but no luck.

The plugin is shown as “Activated” on the plugin page, but still it is not found when I compile the game:

==========================================================

Copyright © 2009-2015  C o r o n a   L a b s   I n c .

Version: 3.0.0

Build: 2015.2799

Platform: iPhone / x86_64 / 10.10.5 / Intel HD Graphics 4000 OpenGL Engine / 2.1 INTEL-10.6.33 / 2015.2799 / de | DE | de_DE | de

Loading project from:   ~/Desktop/Corona/Projects/Freeze-2-tvOS

Project sandbox folder: ~/Library/Application Support/Corona Simulator/Freeze-2-tvOS-23CC5F1A02521671B8624F0CD460F915

WARNING: Disabling the idle timer reduces battery life on the device. Also, there is no timer on the simulator

WARNING: Simulator does not support multitouch events

ERROR: [Lua] Runtime error

module ‘plugin_iCloud’ not found:

no field package.preload[‘plugin_iCloud’]

no file ‘/Users/andreas/Library/Application Support/Corona/Simulator/Plugins/plugin_iCloud.lua’

no file ‘/Users/andreas/Desktop/Corona/Projects/Freeze-2-tvOS/plugin_iCloud.lua’

no file ‘/Applications/CoronaSDK/Corona Simulator.app/Contents/Resources/plugin_iCloud.lua’

no file ‘/Users/andreas/Library/Application Support/Corona/Simulator/Plugins/plugin_iCloud.dylib’

no file ‘./plugin_iCloud.dylib’

no file ‘/Applications/CoronaSDK/Corona Simulator.app/Contents/Resources/plugin_iCloud.dylib’

stack traceback:

[C]: in function ‘require’

?: in function ‘require’

/Users/andreas/Desktop/Corona/Projects/Freeze-2-tvOS/main.lua:96: in main chunk

2015-12-29 22:51:37.856 Corona Simulator[784:25596] Corona Simulator: Goodbye

==========================================================

Thanks & best

Andreas

Are you doing an SDK build or an Enterprise build?

ROb

“Normal” SDK, not Enterprise.

Best
Andreas

There are four reasons for this.

  1. You have not activated the plugin at https://store.coronalabs.com (and make sure Corona SDK is using the same email address that yo used to activate the plugin)

  2. You have not included it in build.settings.

  3. You included it in build.settings but there is an error (which should be flagged by Corona!)

  4. You didn’t include it in the module where you’re trying to access it.

But I would have expected you to have checked all of those things already. Can you verify all of those?

Hi Rob;

I am having an identical problem. As I only “activated” the plugin yesterday morning, I figured that  I would wait until this morning for a more complete test (although I got this error yesterday in my quick tests). Here is the status this morning:

– Build 2799
– Xcode 7.2
– build.settings entries exactly per documents
– Simply invoking this command in main.lua ( [lua] local iCloud = require( “plugin.iCloud”) [/lua] ) does this in these environments:

CORONA SIMULATOR - Throws fatal error and halts running (exact error syntax Andreas described). I know that I could deal with this easily with an environment test of whether it is the “simulator”. But your other plugins are elegant because they fail relatively quietly on the simulator if they are only for devices (i.e. iAds).

XCODE iOS SIMULATOR - Throws fatal Runtime Error (exact error syntax Andreas described).

ON DEVICE (iPad 3) - I was pleasantly surprised to see it run (at least not fail in any obvious manner) when I built and loaded the app on an actual device.

Hope this info is helpful. Know it is in Beta and it is a great addition to the product.

Happy New Year.

Steve

Can you post your build.settings?