If build for Android it works…
This plugin is not available on Simulator?
If build for Android it works…
This plugin is not available on Simulator?
Can you post your build.settings?
Thanks, Rob
-- Supported values for orientation: -- portrait, portraitUpsideDown, landscapeLeft, landscapeRight settings = { orientation = { default = "portrait", content = "portrait", supported = { "portrait", "portraitUpsideDown" } }, excludeFiles = { iphone = { "Icon-\*dpi.png" }, android = { "Icon-120.png", "Icon-152.png", "Icon-16.png", "Icon-24.png", "Icon-32.png", "Icon-40.png", "Icon-40@2x.png", "Icon-60.png", "Icon-60@2x.png", "Icon-60@3x.png", "Icon-64.png", "Icon-72.png", "Icon-72@2x.png", "Icon-76.png", "Icon-76@2x.png", "Icon-Amazon.png", "Icon-Small-40.png", "Icon-Small-40@2x.png", "Icon-Small-40@3x.png", "Icon-Small-50.png", "Icon-Small-50@2x.png", "Icon-Small.png", "Icon-Small@2x.png", "Icon-Small@3x.png", "Icon.png", "Icon@2x.png", }, }, plugins = { ["plugin.facebook.v4"] = { supportedPlatforms={iphone=true, android=true, osx=false, win32=false}, publisherId="com.coronalabs" }, ["plugin.google.play.services"] = { supportedPlatforms={iphone=true, android=true, osx=false, win32=false}, publisherId="com.coronalabs" }, ["plugin.google.iap.v3"] = { supportedPlatforms={iphone=true, android=true, osx=false, win32=false}, publisherId="com.coronalabs" }, ["CoronaProvider.ads.vungle"] = { supportedPlatforms={iphone=true, android=true, osx=false, win32=false}, publisherId="com.vungle" }, }, iphone = { plist = { UIStatusBarHidden = false, UIPrerenderedIcon = true, UIApplicationExitsOnSuspend = false, UIAppFonts = { "nightclub-btn.ttf" }, CFBundleIconFiles = { "Icon-120.png", "Icon-152.png", "Icon-16.png", "Icon-24.png", "Icon-32.png", "Icon-40.png", "Icon-60.png", "Icon-64.png", "Icon-72.png", "Icon-76.png", "Icon-40@2x.png", "Icon-60@2x.png", "Icon-60@3x.png", "Icon-72@2x.png", "Icon-76@2x.png", "Icon-Small-40.png", "Icon-Small-40@2x.png", "Icon-Small-40@3x.png", "Icon-Small-50.png", "Icon-Small-50@2x.png", "Icon-Small.png", "Icon-Small@2x.png", "Icon-Small@3x.png", "Icon.png", "Icon@2x.png", }, FacebookAppID = "XXXXXXXXX", CFBundleURLTypes = { { CFBundleURLSchemes = { "fbXXXXXXXXX", } } }, -- Whitelist Facebook Servers for Network Requests NSAppTransportSecurity = { NSExceptionDomains = { ["fbcdn.net"] = { NSIncludesSubdomains = true, NSExceptionRequiresForwardSecrecy = false, }, ["facebook.com"] = { NSIncludesSubdomains = true, NSExceptionRequiresForwardSecrecy = false, }, ["akamaihd.net"] = { NSIncludesSubdomains = true, NSExceptionRequiresForwardSecrecy = false, }, }, }, -- Whitelist Facebook Apps LSApplicationQueriesSchemes = { "fb", "fbapi20130214", "fbapi20130410", "fbapi20140410", "fbapi20140116", "fbapi20150313", "fbapi20150629", "fbauth", "fbauth2", "fb-messenger-api20140430", }, }, }, android = { usesPermissions = { "android.permission.INTERNET", "android.permission.ACCESS\_NETWORK\_STATE", "com.android.vending.BILLING", "com.android.vending.CHECK\_LICENSE", "android.permission.WRITE\_EXTERNAL\_STORAGE", }, facebookAppId = "XXXX", } }
But this file is also used when open Simulator?
You can’t use Facebook in the simulator. Facebook doesn’t make an SDK for that. On OS-X and Windows they expect people to be making Javascript calls to their REST API.
But you shouldn’t get an error. I know sometimes it takes a little while for plugins to become avaialble, but most of the time it’s an issue with build.settings. It’s odd though that it works on Android but not iOS.
Rob
As of build 2753 I’m still getting that same issue, even though its Facebook V4.
Module 'facebook' not found: no field package.preload['facebook'] no file '/Users/User/Library/Application Support/Corona/Simulator/Plugins/facebook.lua' no file '/Users/User/Desktop/Clients/Game - Public Alpha/Game/src/facebook.lua' no file '/Applications/CoronaSDK/Corona Simulator.app/Contents/Resources/facebook.lua' no file '/Users/User/Library/Application Support/Corona/Simulator/Plugins/facebook.dylib' no file './facebook.dylib' no file '/Applications/CoronaSDK/Corona Simulator.app/Contents/Resources/facebook.dylib' File: module 'facebook' not found
Here are my build settings based on the Corona SDK documentation for V4:
-- -- For more information on build.settings see the Corona SDK Build Guide at: -- http://docs.coronalabs.com/guide/distribution/buildSettings/index.html -- -- Supported values for orientation: -- portrait, portraitUpsideDown, landscapeLeft, landscapeRight settings = { orientation = { default = "landscapeRight", supported = { "landscapeRight", "landscapeLeft" }, }, excludeFiles = { -- Include only the necessary icon files on each platform iphone = { "Icon-\*dpi.png", }, android = { "Icon.png", "Icon-Small-\*.png", "Icon\*@2x.png", }, }, iphone = { plist = { UIAppFonts = { "font.ttf" }, CFBundleDisplayName = "Game", CFBundleName = "Spirdy", CFBundleIconFile = "Icon.png", CFBundleIconFiles = { "Icon.png", "Icon@2x.png", "Icon-60.png", "Icon-60@2x.png", "Icon-60@3x.png", "Icon-72.png", "Icon-72@2x.png", "Icon-76.png", "Icon-76@2x.png", "Icon-Small.png", "Icon-Small@2x.png", "Icon-Small@3x.png", "Icon-Small-40.png", "Icon-Small-40@2x.png", "Icon-Small-50.png", "Icon-Small-50@2x.png", }, --required CFBundleURLTypes = { { CFBundleURLSchemes = { "XXXXXXXXXXXXXXX", } } --replace XXXXXXXXXX with your Facebook App ID }, UILaunchImages = {}, --required UIApplicationExitsOnSuspend = false, UIPrerenderedIcon = true, UIStatusBarHidden = true, MinimumOSVersion = "6.0", FacebookAppID = "XXXXXXXXXXXXX", NSAppTransportSecurity = { NSExceptionDomains = { ["fbcdn.net"] = { NSIncludesSubdomains = true, NSExceptionRequiresForwardSecrecy = false, }, ["facebook.com"] = { NSIncludesSubdomains = true, NSExceptionRequiresForwardSecrecy = false, }, ["akamaihd.net"] = { NSIncludesSubdomains = true, NSExceptionRequiresForwardSecrecy = false, }, }, }, -- Whitelist Facebook Apps LSApplicationQueriesSchemes = { "fb", "fbapi20130214", "fbapi20130410", "fbapi20140410", "fbapi20140116", "fbapi20150313", "fbapi20150629", "fbauth", "fbauth2", "fb-messenger-api20140430", }, }, }, -- Android permissions android = { FacebookAppID = "XXXXXXXXXXX", googlePlayGamesAppId = XXXXXXXXX, usesExpansionFile = true, minSdkVersion = "14", largeHeap = true, usesPermissions = { "android.permission.VIBRATE", "android.permission.INTERNET", "com.android.vending.CHECK\_LICENSE", "android.permission.WRITE\_EXTERNAL\_STORAGE", }, }, plugins = { --key is the name passed to the Lua "require()" ["CoronaProvider.gameNetwork.google"] = { --required! publisherId = "com.coronalabs", supportedPlatforms = { android = true }, }, ["plugin.facebook.v4"] = { publisherId = "com.coronalabs" }, ["plugin.google.play.services"] = { publisherId = "com.coronalabs" }, }, }
The build.settings work using build 5731. Anything above that doesn’t. The error above is what I am getting just from having the local facebook = require(“facebook”) in my main.lua. I’m not calling any Facebook functions, just the module.
@orphinsoftwaresllc:
@Simone Valenti: Have you activated the Facebook-v4 plugin in the Plugin Store? https://store.coronalabs.com/plugin/facebook-v4
Thanks sir! I just needed to change the module string in my require function.
Yes, is activated!
Hmm… Try going to the /Users/my_mac_user/Library/Application Support/Corona/Simulator/Plugins directory on your machine, delete anything in there with facebook_v4 in the name. Then quit the Corona Simulator, reopen it, and reopen your Facebook-v4 project. That should re-download the simulator stub for the facebook-v4 plugin.
There are not files with “facebook_v4” in the name.
And you’ve changed all your require statements from require(“facebook”) to require(“plugin.facebook.v4”) Note the “.” and NOT "_"
Yes!
I’ve temporarily fixed not including facebook library when use Simulator. While creating build for Android works fine!
At the end:
after build 2731 I cannot require no facebook plugin in to Simulator: the old and the new (v4), in both cases the (RunTimer) error is the same: module not find!
In my plugin page Facebook is Pre-Activated and Facebook-v4 is Activated.
I’ve just installated the 2015.2755 Build, and there’is always the error. I’ve temporarily fixed not including facebook library when use Simulator…
Do you get the error when you launch the app in your simulator or when you try to build?
Can you try and run our sample app in SampleCode/Networking/Facebook and see if you have the same error?
Rob
Hi Simone Valenti,
I was able to reproduce your issue and figured out the issue.
In your build.settings, you include the Facebook-v4 plugin as such:
["plugin.facebok.v4"] = { publisherId="com.coronalabs" , supportedPlatforms={iphone=true, android=true, osx=false, win32=false}, },
The issue comes from your supportedPlatforms table. By marking osx=false and win32=false, the simulator for those platforms won’t download the plugin stub for Facebook-v4, generating the error you reported.
If you remove those from your supportedPlatforms table, and relaunch your project, the Corona Simulator should download the plugin stubs. You can add them back in after the plugin stub downloads later if you like.
Note that this issue affects any simulator plugin stubs you haven’t downloaded locally, not just the Facebook-v4 plugin.
@Rob Miracle the sample works, and the problem (wrong configuration) is just build.settings. Removing the supportedPlatforms line or set TRUE to osx, there is not the RuntimError.
Thank you!