Module 'facebook' not found

The thing is that it doesn’t even load the plugin since the error triggered shows that the plugin is not found.

local composer = require( “composer” )

local widget = require(“widget”)

local scene = composer.newScene()

local json = require (“json”)

local facebook = require( “plugin.facebook.v4” )

local function handleButtonEvent( event )

            if ( “ended” == event.phase ) then

              facebook.login( facebookListener, { “email”, “user_birthday” } )

                print( “Button was pressed and released” )

            end

        end

        local linkFacebook = widget.newButton(

            {

                width = 80,

                height = 80,

                defaultFile = “ButtonsAccount/FBLink.png”,

                overFile = “ButtonsAccount/FBLinkHL.png”,

                onEvent = handleButtonEvent

            }

        )

        – Position the button

        linkFacebook.x = display.contentCenterX / 2

        linkFacebook.y = display.contentCenterY +205

        buttonsGroup : insert(linkFacebook)

Can you post the complete console log showing the error?

Rob

Feb 14 12:50:48.238 [iOS Simulator] Runtime Error: Runtime error: module ‘plugin.facebook.v4’ not found:resource (plugin.facebook.v4.lu) does not exist in archive

Feb 14 12:50:48.238 [iOS Simulator] no field package.preload[‘plugin.facebook.v4’]

                    [iOS Simulator] no file ‘/Users/Zak/Library/Developer/CoreSimulator/Devices/4E4AE563-0480-4E59-A0E2-AC7A371E320F/data/Containers/Bundle/Application/3A8867D8-4BE9-420E-83DE-ADE4FF9C9A54/Cash Treasure.app/plugin/facebook/v4.lua’

                    [iOS Simulator] no file ‘/Users/Zak/Library/Developer/CoreSimulator/Devices/4E4AE563-0480-4E59-A0E2-AC7A371E320F/data/Containers/Bundle/Application/3A8867D8-4BE9-420E-83DE-ADE4FF9C9A54/Cash Treasure.app/plugin/facebook/v4.lua’

                    [iOS Simulator] no file ‘./plugin/facebook/v4.so’

                    [iOS Simulator] no file ‘/Users/Zak/Library/Developer/CoreSimulator/Devices/4E4AE563-0480-4E59-A0E2-AC7A371E320F/data/Containers/Bundle/Application/3A8867D8-4BE9-420E-83DE-ADE4FF9C9A54/Cash Treasure.app/plugin/facebook/v4.so’

                    [iOS Simulator] no file ‘./plugin.so’

                    [iOS Simulator] no file '/Users/Zak/Library/Developer/CoreSimulator/Devices/4E4AE563-0480-4E59-A0E2-AC7A371E320F/data/Containers/Bundle/Application/3A8867D8-4BE9-420E-83DE-ADE4FF9C9A54/Cash Treasure.app/plugin.so’plugin.facebook.v4

                    [iOS Simulator]

                    [iOS Simulator] stack traceback:

                    [iOS Simulator] [C]: in function ‘error’

                    [iOS Simulator] ?: in function ‘gotoScene’

                    [iOS Simulator] principal.lua:171: in function ‘_onEvent’

                    [iOS Simulator] ?: in function ‘?’

                    [iOS Simulator] ?: in function <?:654>

                    [iOS Simulator] ?: in function <?:169>

And what version of Corona are you using?

2016.2992

Take out the supportedPlatforms line in your build.settings. It’s blocking you from accessing the Xcode simulator version of the plugin.

Rob

Thanks Rob!!!

Problem fixed, i can move on on the login process.