Facebook Sample Code Under Corona Build 2189a not working on IOS 7.0.4

Hi,

Rob we have enclosed our console log let us know if this can provide some insight into the black screen issue for Facebook Sample code for Corona Build 2189.

04/06/14 6:04:04.292 pm com.apple.IconServicesAgent[195]: main Failed to composit image for binding VariantBinding [0x3cd] flags: 0x8 binding: FileInfoBinding [0x457] - extension: pptx, UTI: org.openxmlformats.presentationml.presentation, fileType: ???.

04/06/14 6:04:04.293 pm quicklookd[4316]: Warning: Cache image returned by the server has size range covering all valid image sizes. Binding: VariantBinding [0x203] flags: 0x8 binding: FileInfoBinding [0x103] - extension: pptx, UTI: org.openxmlformats.presentationml.presentation, fileType: ??? request size:16 scale: 1

04/06/14 6:04:04.656 pm Console[4318]: setPresentationOptions called with NSApplicationPresentationFullScreen when there is no visible fullscreen window; this call will be ignored.

04/06/14 6:04:19.552 pm Corona Simulator[4304]: validationTool: /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/Validation

04/06/14 6:04:46.018 pm iTunes[4526]: Entered:_AMMuxedVersion2DeviceConnected, mux-device:2

04/06/14 6:04:46.022 pm iTunes[4526]: tid:1203 - unable to query device capabilities

04/06/14 6:04:47.615 pm com.apple.SecurityServer[14]: Session 100022 created

04/06/14 6:04:50.258 pm AppleMobileBackup[4533]: WARNING: Backing up ddf08ebde12c374fcf67f6146d6801f4b4d289f2

04/06/14 6:04:53.513 pm MDCrashReportTool[4535]: 4535:3674112|CrashReportCopierAFC.m:-[CrashReportCopierAFC copyAndProcessRemotePath:usingConnection:]| ERROR: Could not remove remote path at ./DiagnosticLogs/security.log.20140604T114037Z

04/06/14 6:04:56.736 pm com.apple.usbmuxd[26]: MuxTCPInputSCE received RST for 0x2-ddf08ebde12c374fcf67f6146d6801f4b4d289f2@0xfd140000:52122->0x100518e20-MDCrashReportTool/NULL:19462: sendMuxSegment connection was closed

04/06/14 6:04:56.876 pm MDCrashReportTool[4536]: 4536:4722688|CrashReportCopierAFC.m:-[CrashReportCopierAFC copyAndProcessRemotePath:usingConnection:]| ERROR: Could not remove remote path at ./DiagnosticLogs/security.log.20140604T114037Z

04/06/14 6:04:57.344 pm com.apple.usbmuxd[26]: MuxTCPInputSCE received RST for 0x2-ddf08ebde12c374fcf67f6146d6801f4b4d289f2@0xfd140000:52167->0x1002099e0-iTunes/com.apple.iTunes:26374: sendMuxSegment connection was closed

04/06/14 6:04:58.742 pm mds[39]: (Normal) ImportServer: Ignoring blacklisted Spotlight importer plugin:/Developer/old/Applications/Xcode.app/Contents/Library/Spotlight/SourceCode.mdimporter uuid:548A3091-3C5D-498A-A329-B532A6C896BB version:1801

04/06/14 6:05:09.107 pm Finder[143]: FIXME: IOUnserialize has detected a string that is not valid UTF-8, “*”.

04/06/14 6:05:09.130 pm Finder[143]: FIXME: IOUnserialize has detected a string that is not valid UTF-8, “*”.

04/06/14 6:05:18.569 pm Finder[143]: FIXME: IOUnserialize has detected a string that is not valid UTF-8, “*”.

04/06/14 6:05:38.136 pm com.apple.usbmuxd[26]: MuxTCPInputSCE received RST for 0x2-ddf08ebde12c374fcf67f6146d6801f4b4d289f2@0xfd140000:52736->0x10040e210-MDCrashReportTool/NULL:51463: sendMuxSegment connection was closed

04/06/14 6:05:38.242 pm MDCrashReportTool[4541]: 4541:4722688|CrashReportCopierAFC.m:-[CrashReportCopierAFC copyAndProcessRemotePath:usingConnection:]| ERROR: Could not remove remote path at ./DiagnosticLogs/security.log.20140604T114037Z

04/06/14 6:05:39.642 pm iTunes[4526]: AMDeviceSecureTransferPath (thread 0x10a548000): disableDelta: FALSE

04/06/14 6:06:21.534 pm mds[39]: (Normal) ImportServer: Ignoring blacklisted Spotlight importer plugin:/Developer/old/Applications/Xcode.app/Contents/Library/Spotlight/SourceCode.mdimporter uuid:548A3091-3C5D-498A-A329-B532A6C896BB version:1801

04/06/14 6:06:30.116 pm iTunes[4526]: BUG in libdispatch client: kevent[EVFILT_WRITE] delete: “No such file or directory” - 0x2

04/06/14 6:07:53.000 pm kernel[0]: en1: BSSID changed to ec:43:f6:76:54:58

04/06/14 6:07:54.000 pm kernel[0]: AirPort: RSN handshake complete on en1

Sorry Rob wrong console log 

Pls use the one attached below

a notification

Jun  4 18:43:08 lenovos-iPad mobile_assertion_agent[133] <Notice>: service_one_connection: Connection closed for client iTunes.

Jun  4 18:43:35 lenovos-iPad kernel[0] <Debug>: launchd[926] Container: /private/var/mobile/Applications/3F7664C0-75F7-4C0A-9597-ED6021FB85C1 (sandbox)

Jun  4 18:43:35 lenovos-iPad backboardd[28] <Error>: HID: The ‘Passive’ connection ‘Facebook-Test’ access to protected services is denied.

Jun  4 18:43:35 lenovos-iPad networkd[79] <Warning>: Analytics Engine: double ON for app: com.deevolutionstudios.gravefall

Jun  4 18:43:35 lenovos-iPad Facebook-Test[926] <Warning>: Platform: iPad / iPad3,6 / 7.1.1 / PowerVR SGX 554 / OpenGL ES 2.0 IMGSGX554-97.7

Jun  4 18:43:35 lenovos-iPad Facebook-Test[926] <Warning>: Runtime error

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

no field package.preload[‘facebook’]

no file ‘/var/mobile/Applications/3F7664C0-75F7-4C0A-9597-ED6021FB85C1/Facebook-Test.app/facebook.lua’

no file ‘/var/mobile/Applications/3F7664C0-75F7-4C0A-9597-ED6021FB85C1/Facebook-Test.app/facebook.lua’

no file ‘./facebook.so’

no file '/var/mobile/Applications/3F7664C0-75F7-4C0A-9597-ED6021FB85C1/Facebook-Test.app/facebook.so’facebook

stack traceback:

[C]: in function ‘require’

?: in function ‘require’

?: in main chunk

What is your build.settings like @evolvingstudios?

Hi Rob below is our build.settings

settings =

{

orientation =

{

default = “portrait”,

supported = { “portrait” }

},

android =

{

usesPermissions =

{

“android.permission.INTERNET”,

},

},

 

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, [“iphone-sim”] = true },

},

},

 

iphone =

{

plist =

{

CFBundleIconFile = “Icon.png”,

CFBundleIconFiles =

{

                “Icon.png”, 

                “Icon@2x.png”, 

                “Icon-60.png”,

                “Icon-60@2x.png”,

                “Icon-72.png”, 

                “Icon-72@2x.png”,

                “Icon-76.png”,

                “Icon-76@2x.png”, 

                “Icon-Small.png”, 

                “Icon-Small@2x.png”,

                “Icon-Small-40.png”,

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

                “Icon-Small-50.png”, 

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

},

UIApplicationExitsOnSuspend = false, – must be false for single sign-on to work

FacebookAppID = “XXXXXXXXXXXXXXXXX”, – replace XXXXXXXXX with your facebook appId

 

CFBundleURLTypes =

{

{

CFBundleURLSchemes =

{

“fbXXXXXXXXXXXXXXX”, – replace XXXXXXXXX with your facebook appId

 

}

}

}

}

}

}

I don’t see any obvious errors in your build.settings and it looks like you’re including the plugin correctly.  What version of Corona SDK are you using?

Hi, 

Rob We are using XCode 5.1 and Corona Build 2189a,  we have also tried 2189 and 2230, all leading to the same result The facebook sample only shows a black screen on IOS 7 devices. We are using IOS 7.0.4 and IOS 7.1.1

Regards
Sunil

I ran your project and there are two changes I made:

  1. I moved the button handler code after the facebook listener code.  May not have mattered but in a 1 pass compiler, when your onClick is evaluated, it doesn’t know the value of listener yet, so it ends up being nil.  As a safety I flipped the two.

  2. This is the main issue.  The “me” request does not return an array of users in a “data” table; however “me/friends” does.  Since you are using “me”, the response table doesn’t have a “data” member, ergo response.data == nil.  Once I uncommented the “me/friends” request and commented out the “me” request, it ran as expected.

Rob

We are using Corona Version 2189a. 

Hi,

Rob we tried what you have suggested but the error message of missing facebook.lua file is still there. Have pasted the console log of the same app that we have shared on Dropbox as a link. You had managed to get the code working, what version of XCode are you using is 5.1.1 or higher ??

Jun  6 16:52:34 lenovos-iPadUserssunilshobhaDesktopnvmScrumptiousapp facebook-api-part-II-5[878] <Warning>: Platform: iPad / iPad3,6 / 7.1.1 / PowerVR SGX 554 / OpenGL ES 2.0 IMGSGX554-97.7

Jun  6 16:52:34 lenovos-iPadUserssunilshobhaDesktopnvmScrumptiousapp facebook-api-part-II-5[878] <Warning>: Runtime error

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

no field package.preload[‘facebook’]

no file ‘/var/mobile/Applications/B09E98B5-4698-4010-B59C-83A8A992A70B/facebook-api-part-II-5.app/facebook.lua’

no file ‘/var/mobile/Applications/B09E98B5-4698-4010-B59C-83A8A992A70B/facebook-api-part-II-5.app/facebook.lua’

no file ‘./facebook.so’

no file '/var/mobile/Applications/B09E98B5-4698-4010-B59C-83A8A992A70B/facebook-api-part-II-5.app/facebook.so’facebook

stack traceback:

[C]: in function ‘require’

?: in function ‘require’

?: in main chunk

local facebook = require (“facebook”)

This line if commented the app compiles and installs on the device. But the line below does not execute

facebook.request( “me/friends”, “GET” ) because facebook variable is nil now as i have commented 

local facebook = require (“facebook”)

So i just want to know facebook plugin which is included in my build.settings how it can be use in my main.lua file to call 

facebook.request( “me/friends”, “GET” )

You have to have the plugin code in your build.settings for iOS. You do not need it for Android.

In your main.lua you have to have:

local facebook = require(“facebook”)

This must be at the top before you attempt to call any facebook.* calls.  When you click on the button, it calls your click handler, which calls facebook.login().  When the login completes it calls your listener function when then calls your facebook.request() to do the work.

Hi rob it is at the top only. There is no facebook calls made before the line you gave mentioned. Clueless about why are we getting the missing facebook library error no matter what build we use. Sunil

Can you make the current project you are building available?

Hi

Rob we are testing out the facebook sample code that is shipped with Corona SDK, under the networking folder. We also tried the Srumptious sample facebook posting app, we get a black screen in both these if we remove the   require facebook line. If we keep that it does not compile saying that facebook.lua not found in the archive. :frowning:

We have also uploaded the same on dropbox and have enclosed the link here. 

https://www.dropbox.com/s/tk5y5pfcujuzzev/facebook-api-part-II.zip

Let us know if this helps

You can’t remove the require line.  It’s needed to load the library.  The link above loads a zip file that hasn’t been updated since 5/28.  It’s still missing the required plugin code in your build.settings.  There have been several posts by myself and community members saying you need to add the plugin code.

You must do this…  Replace your build.settings with this one:

settings = { &nbsp;&nbsp; &nbsp;orientation = &nbsp;&nbsp; &nbsp;{ &nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;default = "portrait", &nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;supported = { "portrait" } &nbsp;&nbsp; &nbsp;}, &nbsp;&nbsp; &nbsp;android = &nbsp;&nbsp; &nbsp;{ &nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;usesPermissions = &nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;{ &nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;"android.permission.INTERNET", &nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;}, &nbsp;&nbsp; &nbsp;}, &nbsp;&nbsp; &nbsp;iphone = &nbsp;&nbsp; &nbsp;{ &nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;plist = &nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;{ &nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;CFBundleIconFile = "Icon.png", &nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;CFBundleIconFiles = &nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;{ &nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;"Icon.png", &nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;"Icon@2x.png", &nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;"Icon-72.png", &nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;"Icon-72@2x.png", &nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;}, &nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;UIApplicationExitsOnSuspend = false,&nbsp;&nbsp; &nbsp;-- must be false for single sign-on to work &nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;FacebookAppID = "XXXXXX",&nbsp;&nbsp; &nbsp;-- replace XXXXXXXXX with your facebook appId &nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;CFBundleURLTypes = &nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;{ &nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;{ &nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;CFBundleURLSchemes = &nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;{ &nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;"fbXXXXX", -- replace XXXXXXXXX with your facebook appId &nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;} &nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;} &nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;} &nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;} &nbsp;&nbsp; &nbsp;}, &nbsp;&nbsp;&nbsp; plugins = &nbsp;&nbsp;&nbsp; { &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; -- key is the name passed to Lua's 'require()' &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ["facebook"] = &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; { &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; publisherId = "com.coronalabs", &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; supportedPlatforms = { iphone=true, ["iphone-sim"]=true }, &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }, &nbsp;&nbsp;&nbsp; }, }

You of course will need to replace the XXXX’s with your Facebook AppID.

Rob we only mentioned about removing the line to show that we are able to compile the app. The build settings that you have shared is what we have been fighting with since the past 2 weeks. Its not working. We even moved the facebook plugin code to the too, result is the same. You can verify from the dropbox link the build settings are the same as the one you have shared. Even the latest daily build of 2332 sample facebook code gives same error about missing facebook.lua file in the archive.

I don’t know what’s going on.  I changed your code to uncomment out the me/friends call and comment out your “me” call and it built just fine, no errors, I installed it on my iPad (had to change the AppID to mine of course) and it ran fine and I got friend pics drawn randomly over my screen.

I seriouslly suspect that you may be running Corona against your drop box folder and updating a different one.  I just downloaded the link listed above (produces a zip file) and it’s the exact same contents as the other 4 times I’ve downloaded and unzipped that file.  If your updating dropbox, your not rebuilding and resharing the zip file. 

Can you post your log error?

I think you forgot to add facebook plugin in build.settings

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

Best Regards,

Team, SP Technolab

www.sptechnolab.com

 settings =

{

orientation =

{

default = “portrait”,

supported = { “portrait” }

},

android =

{

usesPermissions =

{

“android.permission.INTERNET”,

},

},

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, [“iphone-sim”] = true },

},

},

iphone =

{

plist =

{

CFBundleIconFile = “Icon.png”,

CFBundleIconFiles =

{

                “Icon.png”, 

                “Icon@2x.png”, 

                “Icon-60.png”,

                “Icon-60@2x.png”,

                “Icon-72.png”, 

                “Icon-72@2x.png”,

                “Icon-76.png”,

                “Icon-76@2x.png”, 

                “Icon-Small.png”, 

                “Icon-Small@2x.png”,

                “Icon-Small-40.png”,

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

                “Icon-Small-50.png”, 

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

},

UIApplicationExitsOnSuspend = false, – must be false for single sign-on to work

FacebookAppID = “XXXXXXXXXXXXXXXXX”, – replace XXXXXXXXX with your facebook appId

CFBundleURLTypes =

{

{

CFBundleURLSchemes =

{

“fbXXXXXXXXXXXXXXX”, – replace XXXXXXXXX with your facebook appId

}

}

}

}

}

}

Attached is our build settings. The FB APP ID has been hidden on purpose. 

Can you check and let us know what is causing this

Also on Corona Terminal we are getting dvtFoundationBundle : error on Corona Terminal

Dunno what is that for??