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