Corona SDK 2013.2100
Android 2.3.6 and 4.4
When I try to select a photo using media.selectPhoto nothing is selected and the following gets logged the device log:
D/MediaPlayer(10871): at com.ansca.corona.CoronaActivity.getDurationOfVideo(CoronaActivity.java:1188)
D/MediaPlayer(10871): at com.ansca.corona.CoronaActivity.access$200(CoronaActivity.java:22)
D/MediaPlayer(10871): at com.ansca.corona.CoronaActivity$SelectMediaActivityResultHandler$1.run(CoronaActivity.java:1379)
I/Corona (10871): Runtime error
I/Corona (10871): ?:0: attempt to index a nil value
I/Corona (10871): stack traceback:
I/Corona (10871): [C]: ?
I/Corona (10871): ?: in function ‘?’
I/Corona (10871): ?: in function <?:66>
I/Corona (10871): Runtime error
I/Corona (10871):
I/Corona (10871): stack traceback:
I/Corona (10871): [C]: ?
I/Corona (10871): ?: in function ‘?’
I/Corona (10871): ?: in function <?:66>
The statement I’m using is the following (works fine on iOS devices):
media.selectPhoto{ mediaSource = media.PhotoLibrary, origin = picker.contentBounds, destination = {baseDir=system.TemporaryDirectory, filename=imageName, type="image"}, listener = function(event) if (event.completed) then print("selected") end end}