Facebook library loading fail

I had tried most devices. 

Example - iphone retina (3.5), iOS 7.0.3.  Loaded facebook app

console

Feb 25 19:35:42 Gregs-MacBook-Air.local Facebook[14167] \<Notice\>: BUG in libdispatch: 13B42 - 866 - 0x2 Feb 25 19:35:42 Gregs-MacBook-Air.local Facebook[14167] \<Notice\>: BUG in libdispatch client: kevent[EVFILT\_VNODE] add: "Bad file descriptor" - 0x9 Feb 25 19:35:42 Gregs-MacBook-Air.local Facebook[14167] \<Warning\>: Platform: iPhone Simulator / x86\_64 / 7.0.3 / Apple Software Renderer / OpenGL ES 2.0 APPLE-9.2.1 Feb 25 19:35:42 Gregs-MacBook-Air.local lsd[14137] \<Warning\>: LaunchServices:(called by PID 14167) Identifiers file does not exist. Feb 25 19:35:42 Gregs-MacBook-Air.local lsd[14137] \<Warning\>: LaunchServices:(called by PID 14167) Creating new identifiers file. Feb 25 19:35:42 Gregs-MacBook-Air.local Facebook[14167] \<Warning\>: Runtime error module 'facebook' not found:resource (facebook.lu) does not exist in archive no field package.preload['facebook'] no file '/Users/greg/Library/Application Support/iPhone Simulator/7.0.3/Applications/B6EE78B9-F84A-40D2-8D0D-0004C36357EB/Facebook.app/facebook.lua' no file '/Users/greg/Library/Application Support/iPhone Simulator/7.0.3/Applications/B6EE78B9-F84A-40D2-8D0D-0004C36357EB/Facebook.app/facebook.lua' no file './facebook.so' no file '/Users/greg/Library/Application Support/iPhone Simulator/7.0.3/Applications/B6EE78B9-F84A-40D2-8D0D-0004C36357EB/Facebook.app/facebook.so'facebook stack traceback: [C]: in function 'require' ?: in function 'require' ?: in main chunk

Have you added facebook as a plugin yet?  This is a change required for iOS.

Rob

Do I need to do anything beyond including it in the build.settings?

The sample apps build.settings:

plugins = { -- key is the name passed to Lua's 'require()' This section is only required for builds \> 2014.2165 ["facebook"] = { -- required publisherId = "com.coronalabs", supportedPlatforms = { iphone = true }, }, },

From http://docs.coronalabs.com/guide/social/implementFacebook/

settings = { plugins = { -- key is the name passed to Lua's 'require()' ["CoronaProvider.native.popup.social"] = { -- required publisherId = "com.coronalabs", }, }, }

The social plugin is a different beast than the facebook library.  They are different plugins.  If you’re not using Facebook through the social plugin, then you only need the facebook one.  If you are not calling facebook.login() in your code but are only using native.showPopUp() then you need the social version, not the facebook only version.

Rob

Is there anything I can do to fix the issue i’m having in the iOS simulator?

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

Can I find a copy of the facebook.lu file and place it in my project directly to get me over this hurdle?

No, there isn’t a facebook.lu file (it’s really facebook.lua, but…)  You have to get it from the plugin.  Can you post your build.settings for me?

I just downloaded the latest daily build (2187) and used the sample facebook app.  I edited the build.settings and inserted my faceookAppID.  I then modified mail.lua and added my appID and apiKey.

The build.settings are exactly the same as the sample app provided with the SDK, except for the proper appID

Apparently the iOS simulator is considered a different platform.  Add this to your plugin block:

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

Rob

Hi @kirumbik,

Are you using Corona daily build #2165 or later? If so, you need to include Facebook as a plugin. We had to do this because of a recent change in Apple’s approval policies.

Just include this in your “build.settings” file and Facebook should work as normal:

[lua]

settings = {

    plugins =

    {

        [“facebook”] =

        {

            publisherId = “com.coronalabs”,

            supportedPlatforms = { iphone = true },

        },

    },

}

[/lua]

Best regards,

Brent

Thank you for response Brent! But I’m still having the same error on simulator…

Hi @kirumbik,

Which version of Corona? And which version of OS X? 

Corona 2014.2170, OS X 10.9

Hmmm, this is odd. Can you restart the Simulator and then see if the problem persists?

Yep, still the same

Hey,

We’ve just updated the plugin.  Can you please try building and trying on the simulator again?  Thanks.

@kirumbik, try to cut-n-paste the plugins table on the top of the settings table in build.settings file, before iphone or Android settings - I know it sounds strange, but I had a similar problem and this move made a trick

You should really update the facebook documentation with this change.  I was clueless until I found this post about the “iphone-sim” in the plugin block.  The official docs do not say this.

Hi @nahmeenstudios,

I will make the requested changes soon. Thanks for the suggestion.

Best regards,

Brent

Yes, very strange you made such a change and didn’t explain how to get the plugin.

Built for device and was getting the black screen with the loading circle.

Lost some time until I discovered this thread…

Please be more transparent when you make such changes.

What was the reason for moving it to plugin only for iOS?