-
Notifications
You must be signed in to change notification settings - Fork 29.7k
Description
Steps to Reproduce
I'm trying to use the retrieveLostData() function in my flutter app due to my android device constantly crashing when taking an image with the camera. I've wired the retrieveLostData() function into a start up check so that I will be able to then get the image and do with it as i need however whenever i call the function it is throwing a PlatformException error as follows:
[ERROR:flutter/lib/ui/ui_dart_state.cc(148)] Unhandled Exception: PlatformException(error, java.lang.Integer cannot be cast to java.lang.Double, null) E/flutter (17053): #0 StandardMethodCodec.decodeEnvelope (package:flutter/src/services/message_codecs.dart:564:7) E/flutter (17053): #1 MethodChannel.invokeMethod (package:flutter/src/services/platform_channel.dart:316:33) E/flutter (17053): <asynchronous suspension> E/flutter (17053): #2 MethodChannel.invokeMapMethod (package:flutter/src/services/platform_channel.dart:344:48) E/flutter (17053): <asynchronous suspension> E/flutter (17053): #3 ImagePicker.retrieveLostData (package:image_picker/image_picker.dart:107:24) E/flutter (17053): <asynchronous suspension>
The code that I am using for the function is a straight copy from the image_picker plugin page on pub.dev as follows:
Future<void> retrieveLostData() async { final LostDataResponse response = await ImagePicker.retrieveLostData(); if (response == null) { return; } if (response.file != null) { setState(() { if (response.type == RetrieveType.video) { _handleVideo(response.file); } else { _handleImage(response.file); } }); } else { _handleError(response.exception); } }
Image picker is updated to the latest version image_picker 0.6.1+2. Any ideas as to why it keep throwing this exception? I really need to get this working as my app is simply not shippable with it constantly crashing when taking a picture.