module 'facebook' not found:resource (facebook.lu) does not exist in archive

Hi, I’m adding facebook sharing to a new app i’m working on. everythings works fine on IOS, but I keep on getting a black screen on Android along with this error.

10-28 16:02:14.568: I/Corona(27544): /Users/jenkins/slaveroot/workspace/Templates/label/android/subrepos/storyboard/storyboard.lua:1613: /Users/jenkins/slaveroot/workspace/Templates/label/android/platform/resources/init.lua:820: module 'facebook' not found:resource (facebook.lu) does not exist in archive 10-28 16:02:14.568: I/Corona(27544): no field package.preload['facebook'] 10-28 16:02:14.568: I/Corona(27544): no file '(null)/facebook.lua' 10-28 16:02:14.568: I/Corona(27544): no file '(null)/facebook.lua' 10-28 16:02:14.568: I/Corona(27544): no file '/data/data/com.app5ive.games.snake/lib/libfacebook.so' 10-28 16:02:14.568: I/Corona(27544): no file './facebook.so' 10-28 16:02:14.568: I/Corona(27544): no file '(null)/facebook.so' 10-28 16:02:14.568: I/Corona(27544): stack traceback: 10-28 16:02:14.568: I/Corona(27544): [C]: in function 'error' 10-28 16:02:14.568: I/Corona(27544): /Users/jenkins/slaveroot/workspace/Templates/label/android/subrepos/storyboard/storyboard.lua:1613: in function 'gotoScene' 10-28 16:02:14.568: I/Corona(27544): /Users/andreglegg/Documents/app5ive/Snake/menu.lua:107: in function 'listener' 10-28 16:02:14.568: I/Corona(27544): /Users/jenkins/slaveroot/workspace/Templates/label/android/subrepos/timer/timer.lua:173: in function 'method' 10-28 16:02:14.568: I/Corona(27544): /Users/jenkins/slaveroot/workspace/Templates/label/android/platform/resources/init.lua:253: in function \</Users/jenkins/slaveroot/workspace/Templates/label/andr

This is what my build.settings looks like.

settings = { plugins = { ["facebook"] = { publisherId = "com.coronalabs", supportedPlatforms = { iphone=true, ["iphone-sim"]=true }, }, -- key is the name passed to Lua's 'require()' ["CoronaProvider.analytics.flurry"] = { -- required publisherId = "com.coronalabs", }, -- key is the name passed to Lua's 'require()' ["plugin.GameThrivePushNotifications"] = { -- required publisherId = "com.gamethrive", }, ["plugin.google.play.services"] = { publisherId = "com.coronalabs", }, ["CoronaProvider.gameNetwork.apple"] = { publisherId = "com.coronalabs", supportedPlatforms = { iphone=true }, }, }, orientation = { default = "portrait", --landscapeRight supported = { "portrait", }, }, android = { googlePlayGamesAppId = "xxx149901xxx", usesPermissions = { "android.permission.INTERNET", "android.permission.VIBRATE", }, }, iphone = { plist = { CFBundleIconFile = "Icon.png", CFBundleIconFiles = { "Icon.png" , "Icon@2x.png" , "Icon-72.png" , }, UIAppFonts = { "TulpenOne-Regular.ttf", "TulpenOne-Regular.otf", }, UIStatusBarHidden = false, UIPrerenderedIcon = true, -- set to false for "shine" overlay --UIApplicationExitsOnSuspend = true, -- uncomment to quit app on suspend UIApplicationExitsOnSuspend = false, FacebookAppID = "xxx562315583xxx", -- replace XXXXXXXXX with your facebook appId UIBackgroundModes = {"remote-notification"}, -- iOS app URL schemes: CFBundleURLTypes = { { CFBundleURLSchemes = { "fbxxx562315583xxx", } } }, }, }, }

What could be wrong? Been stuck for a while and would greatly appreciate any help I could get. Thanks :) 

Hi @andreglegg,

Are you using a daily build >= 2430? If so, Facebook was moved to a plugin for Android in that build and later, and thus you need to remove that “supportedPlatforms” line when you include the plugin (note that you’re currently limiting it to “iphone” and “iphone-sim”, which would explain why it’s not loading on Android).

See the docs for more info:

http://docs.coronalabs.com/daily/api/library/facebook/index.html

Hope this helps,

Brent

Spot on! thank you :) 

Hi @andreglegg,

Are you using a daily build >= 2430? If so, Facebook was moved to a plugin for Android in that build and later, and thus you need to remove that “supportedPlatforms” line when you include the plugin (note that you’re currently limiting it to “iphone” and “iphone-sim”, which would explain why it’s not loading on Android).

See the docs for more info:

http://docs.coronalabs.com/daily/api/library/facebook/index.html

Hope this helps,

Brent

Spot on! thank you :) 

Hi I been trying to do this and only developing for iPhone, but getting same error when I call:

local facebook = require( “facebook” ) --this line on the game over screen. 

I do have the code for plug in, under settings and followed steps in the guide. Do I need to do the require (“facebook”) part now that its a plug in or leave it out? 

Thank you, any help would be appreciated. 

Hi @nizami71987,

Yes, you still need to require( “facebook” ) as indicated in the guide, and include it within your build.settings:

https://docs.coronalabs.com/plugin/facebook/index.html

If this still doesn’t work, we’ll need to gather more details from your error reports as to why.

Thanks,

Brent

Hi I been trying to do this and only developing for iPhone, but getting same error when I call:

local facebook = require( “facebook” ) --this line on the game over screen. 

I do have the code for plug in, under settings and followed steps in the guide. Do I need to do the require (“facebook”) part now that its a plug in or leave it out? 

Thank you, any help would be appreciated. 

Hi @nizami71987,

Yes, you still need to require( “facebook” ) as indicated in the guide, and include it within your build.settings:

https://docs.coronalabs.com/plugin/facebook/index.html

If this still doesn’t work, we’ll need to gather more details from your error reports as to why.

Thanks,

Brent