Problem with media.selecPhoto

I have problem is using the API media.selecPhoto

Here is my codes. these are the sample code from corona

[lua]local function onComplete(event)
local photo = event.target
print( "photo w,h = " … photo.width … “,” … photo.height )
end

if media.hasSource( media.PhotoLibrary ) then
media.selectPhoto( { mediaSource = media.PhotoLibrary, listener = onComplete } )
else
native.showAlert( “Corona”, “This device does not have a photo library.”, { “OK” } )
end[/lua]

when I run in the simulator
it shows

Attempt to call field ‘selectPhoto’ (a nil value)

I dun know how to solve, please help

me to have the same issue, unable to solve… cant find solution online and the SDK samples makes the same error!!

PLease help!!!

Can you make sure you have to written over the media object with a variable/function/module of your own?

Rob

me to have the same issue, unable to solve… cant find solution online and the SDK samples makes the same error!!

PLease help!!!

Can you make sure you have to written over the media object with a variable/function/module of your own?

Rob