Facebook library loading fail

@nahmeenstudios

You are right, thank you.

My fault and sorry for false alarm. Was not paying enough attention to syntax, somehow I expected Corona will throw some error if there is syntax error.

Regards,
Damir.

Sorry.  Mis-read.  It should work on the iOS sim.

@gjaman, what device are you simulating on the iOS simulator?

Can you open the Console app on your mac and look through the messages for errors (that’s where the iOS simulator dumps your Lua prints)

Rob

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

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?

Hi @ubj3d.android,

This was done because Apple started rejecting apps that got the advertising ID even if the app did not show any ads.

The docs are now updated on this point:

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

Takre care,

Brent

So it is possible to be rejected by Apple only because using facebook ?

It shouldn’t be now, as a result of FB being pulled out into a plugin.

Bug after bug (sorry I am a bit mad, admob listener bug, webpopup, now this).

Added this to my build.settings

[“facebook”] = { publisherId = “com.coronalabs”, supportedPlatforms = { iphone = true }, [“iphone-sim”]=true},

but still getting the : Runtime error module facebook not found when I compile to XCode simulator.

That doesn’t look syntactically correct.  There should be another closing brace or the brace after iphone = true needs moved outward.

[“facebook”] = { publisherId = “com.coronalabs”, supportedPlatforms = { iphone = true , [“iphone-sim”]=true } },

Or something like that.

Rob

Hi Rob,

sorry I did not copy/paste it right.

Here is how it looks like in build.settings:

&nbsp;&nbsp;&nbsp;&nbsp;plugins = &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;["facebook"] = { publisherId = "com.coronalabs", supportedPlatforms = { iphone = true }, ["iphone-sim"]=true},&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;},&nbsp; &nbsp;

So it is not a syntax error causing the error.

Regards,
Damir.