What is causing this Flutter image_picker error - flutter

I remember having this issue once in the past but not how I fixed it. I have a fairly simple function to allow users to update their profile picture but it fails at the first step final XFile? image = await ImagePicker().pickImage(source: ImageSource.gallery);
Here is the first error:
2022-08-13 13:21:44.215616+0300 Runner[3940:211672] [core] "Error returned from daemon: Error Domain=com.apple.accounts Code=7 "(null)""
2022-08-13 13:21:44.230196+0300 Runner[3940:211673] [PAAccessLogger] Failed to log access with error: access=<PATCCAccess 0x2806da5b0> accessor:<<PAApplication 0x282ab0500 identifierType:auditToken identifier:{pid:3940, version:11538}>> identifier:EF438868-FF12-4741-9ACF-88D57992D9BE kind:intervalEnd timestampAdjustment:0 tccService:kTCCServicePhotos, error=Error Domain=PAErrorDomain Code=10 "Possibly incomplete access interval automatically ended by daemon"
The only setup needed in iOS for this package is adding permissions in the info.plist file which I've done. That is also how the function is shown in the pub package so there's no reason it shouldn't work. The error I will show below implies that I'm using something like maxWidth, maxHeight, or trying to compress the image, but I'm not using any of those parameters. It also seems like the image file is referred to as null, which is why I think the above error is the issue. Any other similar questions I've seen had no answers and most were using those parameters. I appreciate any ideas.
Error 2:
2022-08-13 13:21:44.243912+0300 Runner[3940:211261] image_picker: compressing is not supported for type (null). Returning the image with original quality
Of course, I wanted to see what I could do to get around this until a solution is found so I changed the image source to the camera instead of the gallery. Now there is no error from image_picker, but the next step is creating an Image from the XFile? Image.file(File(image!.path)). I have to use a null check on the XFile but I get an error saying it is null. That mean although no error is given by image_picker, it's not actually returning an image.

Related

how do i fix Bad state error: Source maps are not done loading

i am getting this error when debugging in web flutter:
Bad state: Source maps are not done loading.
at Object.j3 (http://localhost:62170/stack_trace_mapper.js:244:69)
at jT (http://localhost:62170/stack_trace_mapper.js:2641:10)
at http://localhost:62170/stack_trace_mapper.js:2635:42
at dart._StackTrace.new.toString (http://localhost:62170/dart_sdk.js:7956:19)
at Object.str (http://localhost:62170/dart_sdk.js:5654:32)
when running to line:
final Iterable frames = filter('${FlutterError.demangleStackTrace(stack)}'.trimRight().split('\n'));
after the deployment everything seems to work correctly, I also checked the consol and there are no errors.

Cannot copy file to local storage android flutter

I am trying to pick image from gallery or camera by image_picker, and save image at specific location. My code work perfectly when i pick image from camera, but it through an exception when i pick from gallery while saving. Here is my code
onPressed: () async {
final XFile? image = await picker.pickImage(source: ImageSource.gallery);
File tempFile = File(image.path);
tempFile = await tempFile.copy('storage/emulated/0/$image.name');
}
Above code through an exception
[ERROR:flutter/lib/ui/ui_dart_state.cc(199)] Unhandled Exception: FileSystemException: Cannot copy file to 'storage/emulated/0//6544578463230218846.jpg', path = '/data/user/0/com.example.nysu/cache/image_picker6544578463230218846.jpg' (OS Error: No such file or directory, errno = 2)
First make sure that you have the required permissions:
For example for Android you need:
Also the file path seems a bit weird with the extra "/", you might want to fix that if it is not intentional:
'storage/emulated/0//6544578463230218846.jpg'
Like so:
tempFile = await tempFile.copy('storage/emulated/0$image.name');
Basic Flow of my application is that, firs i choose image from gallery or camera and then i input name for image from user and then i save image with user provided name to local storage.
So in between interval of choosing image and after that input name, cache memory for image picker is lost some time, because of this (OS Error: No such file or directory, errno = 2) happens.
To solve this i input name before choosing image, and instantly save image after choosing them. It works perfectly.

Unity Issue an WebGL: FSBTool ERROR: Failed with error code 80004001

This is only with WebGL
Errors during import of AudioClip Assets/Audio/background.wav:
FSBTool ERROR: Failed with error code 80004001
FSBTool ERROR: Failed encoding audio clip '/Assets/Audio/background.wav' to AAC. Possibly the file is too short. Try to append silence such that the length becomes greater than 256 samples.
I can't add the audio click on WebGL, but on others platforms work perfectly.
I can't add the audio click
Please help.
The error tells you that the Audio-Sequence is too short. Try adding silence (as suggested) to increase the samples of your file.

How to add markers on the map

I'm using the Flutter SDK Version 4.3.1.0.
I would like to display markers on the map and I found that this would be possible via:
final String positionMarkerPath = 'assets/markers/marker.png';
mapScene.addMapMarker(
MapMarker(
geoCoordinates,
MapImage.withFilePathAndWidthAndHeight(positionMarkerPath, 32, 32)));
When using this method I constantly get errors
E/CL_geoviz( 9632): [ERROR] CL_geoviz - Can't find image 'file:///assets/markers/marker.png' in asset repository.
E/CL_geoviz( 9632): [ERROR] CL_geoviz - Can't load image file 'file:///assets/markers/marker.png' to memory stream.
Now, the method MapImage.withFilePathAndWidthAndHeight is documented as follows in the SDK:
Creates a new map image from the provided path to the SVG Tiny image which is weird because I thought that Flutter doesn't even support SVG out of the box. Could that be an issue? Or what am I doing wrong here?
I tried using an SVG, Vector Drawable and a png, tried fully qualifying the path, nothing works
The documentation for MapImage.withFilePathAndWidthAndHeight says that it is only for SVG Tiny format. But it currently does not seem to work as the HERE SDK for Flutter is still in Beta state.
You can instead load and add PNG files as marker like this:
ByteData data = await rootBundle.load('assets/some_image.png');
MapImage image = MapImage.withPixelDataAndImageFormat(Uint8List.view(data.buffer), ImageFormat.png);
MapMarker marker = MapMarker(geoCoordinates, image);
hereMapController.mapScene.addMapMarker(marker);
The assets directory needs to be specified in the pubspec.yaml.

Getting NaN height error in ivy videojs for ember-cli

I have a video set like in example:
autoresize=true naturalWidth=1280 naturalHeight=720
which is actual size but getting the error below.
Even if I take the size off and leave at autoresize=true still get an error.
VIDEOJS: ERROR: Improper value "NaN" supplied for for height
Can anyone help?