Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[firebase_storage]: Error thrown when calling FirebaseStorage multiple times in [Add-to-App] #12988

Open
1 task done
BunnarithHeang opened this issue Jun 22, 2024 · 3 comments
Assignees
Labels
blocked: customer-response Waiting for customer response, e.g. more information was requested. platform: ios Issues / PRs which are specifically for iOS. plugin: storage type: bug Something isn't working

Comments

@BunnarithHeang
Copy link

BunnarithHeang commented Jun 22, 2024

Is there an existing issue for this?

  • I have searched the existing issues.

Which plugins are affected?

Storage

Which platforms are affected?

iOS

Description

I have an issue with calling FirebaseStorage functions in embedded(Add-to-App) Flutter applications when launching the applications for the second or third time. I tried calling any function in Dart code but it does not return any value.

Reproducing the issue

Upon checking the iOS code inside firebase_storage package from the message thrown in the console log, I found that in FLTFirebaseStoragePlugin.m function registerWithRegistrar (line 108), I found a condition to check if MethodChannel has already been assigned before, and it will return from that function. Meaning any subsequent function calls to this package does not trigger to native side.

Screenshot 2024-06-22 at 11 06 06 at night

And I have verified with the same register function in other firebase packages, all do not contain that condition to prevent multiple registrations.

Firebase Core version

10.15.0

Flutter Version

3.7.7

Relevant Log Output

FLTFirebaseStorage was already registered. If using isolates, you can safely ignore this message.

Flutter dependencies

Expand Flutter dependencies snippet
Dart SDK 2.19.4
Flutter SDK 3.7.7

dependencies:
- cloud_firestore 4.9.3 [cloud_firestore_platform_interface cloud_firestore_web collection firebase_core firebase_core_platform_interface flutter meta]
- firebase_auth 4.10.1 [firebase_auth_platform_interface firebase_auth_web firebase_core firebase_core_platform_interface flutter meta]
- firebase_core 2.17.0 [firebase_core_platform_interface firebase_core_web flutter meta]
- firebase_crashlytics 3.3.7 [firebase_core firebase_core_platform_interface firebase_crashlytics_platform_interface flutter stack_trace]
- firebase_database 10.2.7 [firebase_core firebase_core_platform_interface firebase_database_platform_interface firebase_database_web flutter]
- firebase_remote_config 4.2.7 [firebase_core firebase_core_platform_interface firebase_remote_config_platform_interface firebase_remote_config_web flutter]
- firebase_storage 11.2.8 [firebase_core firebase_core_platform_interface firebase_storage_platform_interface firebase_storage_web flutter]

transitive dependencies:
- _flutterfire_internals 1.3.7 [collection firebase_core firebase_core_platform_interface flutter meta]
- cloud_firestore_platform_interface 5.16.2 [_flutterfire_internals collection firebase_core flutter meta plugin_platform_interface]
- cloud_firestore_web 3.7.2 [_flutterfire_internals cloud_firestore_platform_interface collection firebase_core firebase_core_web flutter flutter_web_plugins js]
- firebase_auth_platform_interface 6.19.1 [_flutterfire_internals collection firebase_core flutter meta plugin_platform_interface]
- firebase_auth_web 5.8.2 [firebase_auth_platform_interface firebase_core firebase_core_web flutter flutter_web_plugins http_parser js meta]
- firebase_core_platform_interface 4.8.0 [collection flutter flutter_test meta plugin_platform_interface]
- firebase_core_web 2.8.0 [firebase_core_platform_interface flutter flutter_web_plugins js meta]
- firebase_crashlytics_platform_interface 3.6.7 [_flutterfire_internals collection firebase_core flutter meta plugin_platform_interface]
- firebase_database_platform_interface 0.2.5+7 [_flutterfire_internals collection firebase_core flutter meta plugin_platform_interface]
- firebase_database_web 0.2.3+7 [firebase_core firebase_core_web firebase_database_platform_interface flutter flutter_web_plugins js]
- firebase_remote_config_platform_interface 1.4.7 [_flutterfire_internals firebase_core flutter meta plugin_platform_interface]
- firebase_remote_config_web 1.4.7 [firebase_core firebase_core_web firebase_remote_config_platform_interface flutter flutter_web_plugins js]
- firebase_storage_platform_interface 4.4.7 [collection firebase_core flutter meta plugin_platform_interface]
- firebase_storage_web 3.6.8 [_flutterfire_internals async firebase_core firebase_core_web firebase_storage_platform_interface flutter flutter_web_plugins http js meta]

Additional context and comments

FYI: the Flutter dependencies that I include are only the dependencies that are related firebase packages

@BunnarithHeang BunnarithHeang added Needs Attention This issue needs maintainer attention. type: bug Something isn't working labels Jun 22, 2024
@TarekkMA TarekkMA added plugin: storage platform: ios Issues / PRs which are specifically for iOS. labels Jun 24, 2024
@TarekkMA
Copy link
Contributor

@BunnarithHeang Thank you for reporting this bug. Can you please provide a small reproduction example of this issue? Additionally, could you explain why you need to initialize Firebase Storage multiple times?

@TarekkMA TarekkMA added blocked: customer-response Waiting for customer response, e.g. more information was requested. and removed Needs Attention This issue needs maintainer attention. labels Jun 24, 2024
@TarekkMA TarekkMA self-assigned this Jun 24, 2024
@BunnarithHeang
Copy link
Author

@TarekkMA Technically, I am not actually initializing Firebase Storage multiple times but when I try to present the FlutterViewController multiple times and call any firebase_storage function, it will trigger the ** registerWithRegistrar** function in firebase_storage again and again. However, I observe that the core Firebase Storage instance in native iOS is still alive, the thing that gets initialized multiple times is actually the firebase_storage Flutter package.

FYI: The app host is using native iOS, and I am adding Flutter apps inside and present those Flutter apps.

@google-oss-bot google-oss-bot added Needs Attention This issue needs maintainer attention. and removed blocked: customer-response Waiting for customer response, e.g. more information was requested. labels Jun 24, 2024
@TarekkMA
Copy link
Contributor

Thank you for the clarification. It would be helpful if you could provide a complete but minimal reproduction example of this issue. Thanks!

@TarekkMA TarekkMA added blocked: customer-response Waiting for customer response, e.g. more information was requested. and removed Needs Attention This issue needs maintainer attention. labels Jun 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
blocked: customer-response Waiting for customer response, e.g. more information was requested. platform: ios Issues / PRs which are specifically for iOS. plugin: storage type: bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants