coomar2841 / image-chooser-library

An Easy Image/Video Chooser Library for your Android Apps
646 stars 193 forks source link

"Couldn't process a null file" randomly happening #97

Closed seccomiro closed 8 years ago

seccomiro commented 9 years ago

I'm getting a lot of "Couldn't process a null file" when trying to capture a picture (REQUEST_CAPTURE_PICTURE). This occurs after clicking the OK on captured photo. The big trouble is that it doesn't happen constantly, so I'm not able to debug it and discover the reason the String filePath is null or empty. I've tryed the dev and dev-refactor branches with Android 5.0.2 and 4.1.2. Are there related issues?

coomar2841 commented 9 years ago

Can you give some more details? Some logs if possible? Have you tried the sample app and were you able to reproduce the problem with that? Let me know, and I would look into this.

seccomiro commented 9 years ago

Thanks for replying. I'm creating a ImageChooserManager the library:

imageChooserManager = new ImageChooserManager(a, ChooserType.REQUEST_CAPTURE_PICTURE);
imageChooserManager.setImageChooserListener(this);
imageChooserManager.choose();

then capturing the onImageChosen() event. Inside the library, the message is generated under the processImage() method, by these line of code:

if (filePath == null || TextUtils.isEmpty(filePath)) {
    if (listener != null) {
        listener.onError("Couldn't process a null file");
    }
}

I don't have specific logs, because it doesn't throw any exception. I'm getting the "Couldn't process a null file" message and the process gets cancelled. I've not tryed the sample app. Then I'm going to download that and try to reproduce the problem.

seccomiro commented 9 years ago

Well. I guess it was caused by the onSaveInstanceState() method that I hadn't implemented. I did the things like in the sample app and, apparently, it's working well. Now I have another problem, but I don't know if it's related to this issue: When I do the same action, but for video capture, the app finishes after the OK click, without any error. But this is happening only on the device running Android 4.1.2, the 5.0.2 runs well.

coomar2841 commented 8 years ago

Could you give some logs? And also, what video capture app you are using?

seccomiro commented 8 years ago

Oh sorry! I'm not using the library for this purpose anymore. So I have no pieces of code or logs to send. Sorry.

coomar2841 commented 8 years ago

Ok, No problem. Closing this issue for now.