freshplanet / ANE-ImagePicker

Air Native Extension for mobile camera and gallery features (iOS + Android)
Apache License 2.0
80 stars 48 forks source link

Android: Camera Error - "Cant connect to camera" on second attempt #38

Open ghost opened 9 years ago

ghost commented 9 years ago

Hello

SDK Air17.0 @ Android Nexus 5 Android 5.1.1 SDK22

I've integrated this ANE just fine and it works except for the fact, that when I try to use it a second time, to add another Photo to my Dictionary, The Camera throws an Android OS Error:

Camera Error Can't connect to Camera

What is the best practise on this ANE to activate the native ImagePicker and to stably disable it again, to make it available for a new photoshot? Is it adviced to reinit each time or is there a workflow example of keeping the camera available? Also, is there a log I could parse to see why this Error happens? I've read in some places that the Nexus Series is prone for this error and It might be my dev device after all. Maybe ImagePicker supplies a ErrorEvent dispatcher for that?

Cheers Mortimer

ghost commented 9 years ago

To add to this Error: What Can I Do About The Can’t Connect To Camera Error On My Android

From what I'm reading there, the most common problem seems to be, that the camera is already used by another process. So it might be, that I use the ImagePicker wrong while loading it for the first image, but then on the second image, the camera is still "in use" somehow. Maybe there is a Detail I'm missing on how to accurately attach and detach the camera.