App dpes not run on simulator

Hi,

I got the code below from a tutorial for using Facebook in Corona. I installed in on my Android and it failed for a UI error. Then I tried running it in the simulator and got the following error:

Copyright © 2009-2012 C o r o n a L a b s I n c .
Version: 2.0.0
Build: 2012.894
Runtime error
module ‘ui’ not found:resource (ui.lu) does not exist in archive
no field package.preload[‘ui’]
no file ‘c:\users\warren\documents\corona projects\fb1\ui.lua’
no file ‘C:\Program Files (x86)\Corona Labs\Corona SDK\Resources\ui.lua’

no fRuntime error: module ‘ui’ not found:resource (ui.lu) does not exist
in archive
no field package.preload[‘ui’]
no file ‘c:\users\warren\documents\corona projects\fb1\ui.lua’
no file ‘C:\Program Files (x86)\Corona Labs\Corona SDK\Resources\ui.lua’

no file 'C:\Program

It seems to be missing the ui.lu file? The following code is in the main.lua file.

Thanks!

  
ui = require("ui")  
local facebook = require "facebook"  
  
local appId = "hidden"  
  
local myButton = ui.newButton {  
 defaultSrc = "fb.png" , defaultX = "300" , defaultY = "50",  
 onEvent = onClick,  
 id = "myButton"  
}  
myButton.x = display.contentWidth / 2  
myButton.y = display.contentHeight / 2  
local function onClick( event )  
 if(event.phase == "release") then  
 facebook.login( appId, listener )  
 end  
end  
  
function listener( event )  
 if ( "session" == event.type ) then  
 if ( "login" == event.phase ) then  
 facebook.request( "me" )  
 end  
 elseif ( "request" == event.type ) then  
 local response = event.response  
 print( response )  
 end  
end  

[import]uid: 184193 topic_id: 32553 reply_id: 332553[/import]

I think the UI is not available because I’m not a subscriber yet. So I stripped it out and hoped the Facebook part would just run when I launch the app but I just get a blank screen from the code below. Shouldn’t I get the login dialog?

[code]

local facebook = require “facebook”

local appId = “hidden”
facebook.login( appId, listener )
function listener( event )
if ( “session” == event.type ) then
if ( “login” == event.phase ) then
facebook.request( “me” )
end
elseif ( “request” == event.type ) then
local response = event.response
print( response )
end
end
[/code] [import]uid: 184193 topic_id: 32553 reply_id: 129426[/import]

You should be able to find ui.lua in one of the demo apps and just copy it in to this app folder.

Dave [import]uid: 117617 topic_id: 32553 reply_id: 129443[/import]

Just in case you weren’t aware, Facebook login does not work in the Simulator, only on devices. So you won’t get the login dialog. [import]uid: 84115 topic_id: 32553 reply_id: 129458[/import]

I think the UI is not available because I’m not a subscriber yet. So I stripped it out and hoped the Facebook part would just run when I launch the app but I just get a blank screen from the code below. Shouldn’t I get the login dialog?

[code]

local facebook = require “facebook”

local appId = “hidden”
facebook.login( appId, listener )
function listener( event )
if ( “session” == event.type ) then
if ( “login” == event.phase ) then
facebook.request( “me” )
end
elseif ( “request” == event.type ) then
local response = event.response
print( response )
end
end
[/code] [import]uid: 184193 topic_id: 32553 reply_id: 129426[/import]

You should be able to find ui.lua in one of the demo apps and just copy it in to this app folder.

Dave [import]uid: 117617 topic_id: 32553 reply_id: 129443[/import]

Just in case you weren’t aware, Facebook login does not work in the Simulator, only on devices. So you won’t get the login dialog. [import]uid: 84115 topic_id: 32553 reply_id: 129458[/import]