Flutter camera issue in android version 13 - flutter

In android 13 we are facing the below issue we are using this third party camera plugin (https://pub.dev/packages/camera), I would really appreciate the help to solve the issue, Do we need to make some changes in our android version?
E/flutter (14764): [ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: CameraException(error, Attempt to invoke virtual method 'int android.media.EncoderProfiles$VideoProfile.getWidth()' on a null object reference)
E/flutter (14764): #0 AndroidCamera.createCamera (package:camera_android/src/android_camera.dart:112:7)
E/flutter (14764):
E/flutter (14764): #1 CameraController.initialize (package:camera/src/camera_controller.dart:291:19)
E/flutter (14764):

It's a well known issue that is being tracked here:https://github.com/flutter/flutter/issues/109769
some people came with a solution ( that I haven't tried ) but as of the current state the issue is still not fixed in the latest package version

Related

Flutter error "dart_vm_initializer.cc" Unhandled Exception: 'dart:ui/platform_dispatcher.dart'

I had to reinstall Flutter, Android Studio, Sdk, recreate phone emulator, recreate all my Flutter project because time passes and problems and framework bugs pile up. To keep updated all the Flutter environment without problems seems to be impossible. All the things becomes unstable when new and new Flutter and/or Sdk versions come out.
So I reinstalled everything to have a new, perfectly working environment.
Well, now I have a new, never seen, error:
E/flutter ( 3692): [ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: 'dart:ui/platform_dispatcher.dart': Failed assertion: line 1840 pos 15: '<optimized out>': is not true.
E/flutter ( 3692): #0 _AssertionError._doThrowNew (dart:core-patch/errors_patch.dart:51:61)
E/flutter ( 3692): #1 _AssertionError._throwNew (dart:core-patch/errors_patch.dart:40:5)
E/flutter ( 3692): #2 new Locale.fromSubtags (dart:ui/platform_dispatcher.dart:1840:15)
E/flutter ( 3692): #3 PlatformDispatcher._updateLocales (dart:ui/platform_dispatcher.dart:762:29)
E/flutter ( 3692): #4 _updateLocales (dart:ui/hooks.dart:64:31)
E/flutter ( 3692):
My app works, but how can I get rid of that bug?

Flutter custom native plugin conflicts with project code

For the Flutter app I’m working on, the company had a third party develop native Android and iOS code for an alarm to integrate into our app. I ran their sample app that they made and it ran just fine.
I copied the code over to my project and kept getting this error.
E/flutter (17290): [ERROR:flutter/lib/ui/ui_dart_state.cc(198)] Unhandled Exception: MissingPluginException(No implementation found for method alarmStatus on channel samples.flutter.dev/alarmStatus)
E/flutter (17290): #0 MethodChannel._invokeMethod
E/flutter (17290): #1 _MyHomePageState._getAlarmStatus
E/flutter (17290): <asynchronous suspension>
E/flutter (17290):
E/flutter (17290): [ERROR:flutter/lib/ui/ui_dart_state.cc(198)] Unhandled Exception: MissingPluginException(No implementation found for method alarmStatus on channel samples.flutter.dev/alarmStatus)
E/flutter (17290): #0 MethodChannel._invokeMethod
E/flutter (17290): <asynchronous suspension>
E/flutter (17290): #1 _MyHomePageState._getAlarmStatus
E/flutter (17290): <asynchronous suspension>
E/flutter (17290):
So, I created a new project and copied the code over and it worked great. While doing some troubleshooting, we found out that this issue sometimes appears with dependencies having issues with each other, so I copied all my dependencies from my app to the new project and got the same error. After commenting out dependencies to find which one may be causing the issue, I landed at the audio_service package. We did some more searching through forums and all, but weren’t able to figure out a solution.
Has anyone run into this issue before and been able to figure out what’s going on? Or have any ideas of what I can try?
I got the recommendation of having the other developers redo the native stuff with a different dependency, but I'm hoping to avoid that if possible.

Flutter :No implementation found issue in path_provider while using get_storage in WorkManager

I am Using the GetStorage plugin With Workmanager and trying to access stored data in the Background its through error
[ERROR:flutter/lib/ui/ui_dart_state.cc(209)] Unhandled Exception: MissingPluginException(No implementation found for method getApplicationDocumentsDirectory on channel plugins.flutter.io/path_provider)
E/flutter (11718): #0 GetStorage._init (package:get_storage/src/storage_impl.dart:47:7)
E/flutter (11718):
E/flutter (11718): #1 new GetStorage._internal. (package:get_storage/src/storage_impl.dart:28:7)
E/flutter (11718):
E/flutter (11718): #2 callbackDispatcher (package:anganwadimapping/backgroundProcessCallback.dart:8:3)
E/flutter (11718):
E/flutter (11718):
I think there is no way u can get access to local stored with workmanager when the app closed .
U can Explain ur problem maybe we find another way

i keep having [ERROR:flutter/lib/ui/ui_dart_state.cc(209)] Unhandled Exception: MissingPluginException

[ERROR:flutter/lib/ui/ui_dart_state.cc(209)] Unhandled Exception: MissingPluginException(No implementation found for method Firebase#initializeCore on channel plugins.flutter.io/firebase_core) #0 MethodChannel._invokeMethod package:flutter/…/services/platform_channel.dart:175 #1 MethodChannel.invokeListMethod package:flutter/…/services/platform_channel.dart:363 #2 MethodChannelFirebase._initializeCore package:firebase_core_platform_interface/…/method_channel/method_channel_firebase.dart:31 #3 MethodChannelFirebase.initializeApp package:firebase_core_platform_interface/…/method_channel/method_channel_firebase.dart:73 #4 Firebase.initializeApp
delete the application on your emulator (or wherever you work)
execute
flutter clean
in your working directory and rebuild the app.
flutter sometimes does not recognize plugins automatically.
I had this error and deleting app on device/simulator and installing it again helped me

MissingPluginException(No implementation found for method pickImage on channel plugins.flutter.io/image_picker)

Unhandled Exception: MissingPluginException(No implementation found for method pickImage on channel plugins.flutter.io/image_picker)
E/flutter (16028): #0 MethodChannel._invokeMethod (package:flutter/src/services/platform_channel.dart:159:7)
E/flutter (16028): <asynchronous suspension>
E/flutter (16028): #1 MethodChannel.invokeMethod (package:flutter/src/services/platform_channel.dart:334:12)
E/flutter (16028): #2 MethodChannelImagePicker.pickImagePath (package:image_picker_platform_interface/src/method_channel/method_channel_image_picker.dart:62:21)
E/flutter (16028): #3 MethodChannelImagePicker.pickImage (package:image_picker_platform_interface/src/method_channel/method_channel_image_picker.dart:30:25)
E/flutter (16028): #4 ImagePicker.getImage (package:image_picker/image_picker.dart:101:21)
STEP 1 : Ensure you have imported the plugin by including this in your pubspec.yaml file
image_picker: ^0.6.7+4
STEP 2 : Make sure you have imported the plugin in the file you need it
import 'package:image_picker/image_picker.dart';
STEP 3 : Make sure you run this command
flutter pub get
Now, many times in Flutter even after doing the above 3 steps perfectly you will get the same error.
Here is my solution that has worked for me.
STEP 1 : Run this command in the terminal
flutter clean
STEP 2 : CLOSE/STOP your emulator and start it again
99% of the time this works for me.
just click stop red icon right side of run icon. and restart app