Skip to content

Conversation

@Forzali
Copy link

@Forzali Forzali commented Feb 27, 2025

Hello,

While using the mic_stream library with Flutter 3.29.0, I encountered a compilation error on Android due to the use of the deprecated PluginRegistry.Registrar API, which has been removed in modern Flutter versions (with V2 embedding). To resolve this, I’ve updated MicStreamPlugin.java to use the FlutterPlugin API instead.

Changes made:

Removed the PluginRegistry.Registrar import and registerWith(Registrar) method.
Integrated the plugin with the FlutterPlugin interface using onAttachedToEngine and onDetachedFromEngine.
Defined EventChannel and MethodChannel objects at the class level to improve lifecycle management.
Preserved the existing microphone streaming logic (e.g., runnable, onListen, onCancel) unchanged.
This update makes the library compatible with Flutter 3.29.0 and later versions. I’ve tested it locally, and it works without issues. Merging these changes into the main repository would help the community use this library with current Flutter releases. I’d appreciate your review—thanks!

error: cannot find symbol import io.flutter.plugin.common.PluginRegistry.Registrar;
@anarchuser
Copy link
Owner

Hi, I very much appreciate your efforts.
Naturally I will want to merge your PR; it will take me some time though to verify everything is in order. I hope I can get around to it within the next few days.
Thank you very much!

@Forzali
Copy link
Author

Forzali commented Feb 28, 2025

Hi,
Thanks a lot for your quick response and support! I’m excited to see the merge soon. Really appreciate your effort!
Best,

@anarchuser
Copy link
Owner

Hi, I've made a branch to bump the flutter version and all its android dependencies up: fix/100/upgrade-api

It contains your changes already (was easier to test that way). I'm ready to merge & publish this branch as soon as you confirm that you understand and accept that your changes are going to irreversibly be published.

Thank you again for your initiative and effort in keeping this project alive-ish!

Best regards

@GuillaumeBouxin
Copy link

Hello ! @anarchuser is it possible to merge this one?

@Forzali
Copy link
Author

Forzali commented Mar 5, 2025

Hi, I've made a branch to bump the flutter version and all its android dependencies up: fix/100/upgrade-api

It contains your changes already (was easier to test that way). I'm ready to merge & publish this branch as soon as you confirm that you understand and accept that your changes are going to irreversibly be published.

Thank you again for your initiative and effort in keeping this project alive-ish!

Best regards

Hi,

I’m sorry for replying to you so late. I’ve been going through a busy period and couldn’t get back to you earlier because I hadn’t fully completed my tests and wasn’t entirely sure about the results. I understand what you’ve said, and at the moment, I’m not experiencing any issues while using the package. Still, I’d like to be absolutely certain, so I plan to run one final test. As soon as I confirm everything is working fine, I’ll get back to you as quickly as possible.

Best regards,

@anarchuser
Copy link
Owner

Hi,
@Forzali I can offer to publish it as a development version, if you think that'd help.
Otherwise take your time to test properly.

@GuillaumeBouxin if it's very urgent you can always clone this repo and use this PR instead of a version.

Best regards

@Forzali
Copy link
Author

Forzali commented Mar 6, 2025

Hi @anarchuser,

I think publishing it as a development version is a great idea and would definitely help. Thanks!

Best regards,

@anarchuser
Copy link
Owner

Done. Should be visible within the next ten minutes

@anarchuser
Copy link
Owner

Hi, any update on this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants