I try to require Facebook module, but it shows errors

I try to follow this Facebook API document (http://docs.coronalabs.com/guide/social/implementFacebook/)

So I have a line in main.lua to include Facebook module

local facebook = require(“facebook”)

But then it gives me following error in actual device:

module 'facebook' not found:resource (facebook.lu) does not exist in archive no field package.preload['facebook'] no file '/var/mobile/Applications/9A5269F5-61C1-4C35-8C5D-3F6733B56EE7/MyApp.app/facebook.lua' no file '/var/mobile/Applications/9A5269F5-61C1-4C35-8C5D-3F6733B56EE7/MyApp.app/facebook.lua' no file './facebook.so' no file '/var/mobile/Applications/9A5269F5-61C1-4C35-8C5D-3F6733B56EE7/MyApp.app/facebook.so'facebook stack traceback: [C]: in function 'require' ?: in function 'require'

I have gone through the document a few times… I still can’t find what I am missing…

Any step I am missing here?

Do you have Facebook listed under plugins in build.settings? It’s a new requirement. See gotchas here http://docs.coronalabs.com/daily/api/library/facebook/

In case you are also trying to test in the iOS simulator, there is a new gotchas that isn’t listed on that page…  I ran a similar problem in the simulator.  In supported platforms you need to add:  [“iphone-sim”] = true 

http://forums.coronalabs.com/topic/44133-facebook-library-loading-fail/page-2#entry233909

plugins =     {         ["CoronaProvider.native.popup.social"] = { publisherId = "com.coronalabs", },         ["facebook"]={             publisherId = "com.coronalabs",             supportedPlatforms = { iphone = true, ["iphone-sim"] = true },         },      },  

I had these both problems today… thanks guys…

I didn’t know you could test Facebook in the simulator, or is this for the xCode simulator?

xCode Simulator

Thanks a lot, jonjonsson

I overlooked that one.

Do you have Facebook listed under plugins in build.settings? It’s a new requirement. See gotchas here http://docs.coronalabs.com/daily/api/library/facebook/

In case you are also trying to test in the iOS simulator, there is a new gotchas that isn’t listed on that page…  I ran a similar problem in the simulator.  In supported platforms you need to add:  [“iphone-sim”] = true 

http://forums.coronalabs.com/topic/44133-facebook-library-loading-fail/page-2#entry233909

plugins =     {         ["CoronaProvider.native.popup.social"] = { publisherId = "com.coronalabs", },         ["facebook"]={             publisherId = "com.coronalabs",             supportedPlatforms = { iphone = true, ["iphone-sim"] = true },         },      },  

I had these both problems today… thanks guys…

I didn’t know you could test Facebook in the simulator, or is this for the xCode simulator?

xCode Simulator

Thanks a lot, jonjonsson

I overlooked that one.