endmr11 / ed_screen_recorder

Screen recorder plugin for Flutter. Supports IOS and Android devices.
MIT License
26 stars 34 forks source link

stopRecord() stop working when import Firebase Analytics #92

Closed ghost closed 4 months ago

ghost commented 1 year ago

Hey guys,

I got a weird issue when using this package.

In this repo: https://github.com/arctouch-rafaelnagai/screen_record_issue

I implemented a simple project only using ed_screen_recorder and path_provider. The project is working, but when I import the firebase_analytics to the project, the stopRecord method from ed_screen_recorder stops working. I don't need to initialize the Firebase, if I just import in the pubspec file the method break.

it didn't give any error, log, or exception.

this method just stops working.

This behavior happens only in Android platform, and probably is something related to HBRecorder and how is working behind of scenes.

Someone knows how can I fix it?


Flutter doctor

Run flutter doctor and paste the output below:

Click To Expand ``` [!] Flutter (Channel stable, 3.10.6, on macOS 13.4.1 22F770820d darwin-x64, locale en-BR) ! Warning: `dart` on your path resolves to /usr/local/Cellar/dart/2.18.6/libexec/bin/dart, which is not inside your current Flutter SDK checkout at /Users/rafaelnagai/Documents/flutter. Consider adding /Users/rafaelnagai/Documents/flutter/bin to the front of your path. [✓] Android toolchain - develop for Android devices (Android SDK version 32.0.0) [✓] Xcode - develop for iOS and macOS (Xcode 14.3.1) [✓] Chrome - develop for the web [✓] Android Studio (version 2020.3) [✓] Android Studio (version 2021.3) [✓] VS Code (version 1.71.2) [✓] VS Code (version 1.63.0) [✓] Connected device (2 available) [✓] Network resources ```

Flutter dependencies

Run flutter pub deps -- --style=compact and paste the output below:

Click To Expand ``` - async 2.11.0 [collection meta] - boolean_selector 2.1.1 [source_span string_scanner] - characters 1.3.0 - clock 1.1.1 - collection 1.17.1 - crypto 3.0.3 [typed_data] - fake_async 1.3.1 [clock collection] - ffi 2.1.0 - js 0.6.7 [meta] - lints 2.1.1 - matcher 0.12.15 [async meta stack_trace term_glyph test_api] - material_color_utilities 0.2.0 - meta 1.9.1 - path 1.8.3 - path_provider_android 2.1.0 [flutter path_provider_platform_interface] - path_provider_foundation 2.3.0 [flutter path_provider_platform_interface] - path_provider_linux 2.2.0 [ffi flutter path path_provider_platform_interface xdg_directories] - path_provider_platform_interface 2.1.0 [flutter platform plugin_platform_interface] - path_provider_windows 2.2.0 [ffi flutter path path_provider_platform_interface win32] - platform 3.1.0 - plugin_platform_interface 2.1.5 [meta] - sky_engine 0.0.99 - source_span 1.9.1 [collection path term_glyph] - stack_trace 1.11.0 [path] - stream_channel 2.1.1 [async] - string_scanner 1.2.0 [source_span] - term_glyph 1.2.1 - test_api 0.5.1 [async boolean_selector collection meta source_span stack_trace stream_channel string_scanner term_glyph matcher] - typed_data 1.3.2 [collection] - uuid 3.0.7 [crypto] - vector_math 2.1.4 - win32 5.0.6 [ffi] - xdg_directories 1.0.2 [meta path] ```

ghost commented 1 year ago

if someone needs a fix for this problem... I will try to explain what is happening.

This lib implements HBRecorderListener from HBRecorder, for some reason that I didn't know yet when we implement firebase_analytics, the HBRecorderOnComplete() method is called before we stop the recording.

in this branch from my repo: https://github.com/arctouch-rafaelnagai/screen_record_issue/tree/fix/android-issue

I made a workaround, basically, I copied the code from this lib, created my method channel and called again the HBRecorderOnComplete() after call the stopRecord.

I hope they fix it, but if you need an emergency... I think this code can help