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_ui_storage] UploadButton not working #312

Open
1 task done
Ostabo opened this issue Mar 18, 2024 · 1 comment
Open
1 task done

🐛 [firebase_ui_storage] UploadButton not working #312

Ostabo opened this issue Mar 18, 2024 · 1 comment
Labels
blocked: flutter bug Something isn't working storage

Comments

@Ostabo
Copy link

Ostabo commented Mar 18, 2024

Is there an existing issue for this?

  • I have searched the existing issues and found no duplicates.

What plugin is this bug for?

Firebase UI Storage

What platform(s) does this bug affect?

Android

List of dependencies used.

flutter pub deps -s list
  Dart SDK 3.4.0-227.0.dev
Flutter SDK 3.21.0-7.0.pre.8
firebase_ui_storage 2.0.3   

dependencies:

  • flutter 0.0.0
    • characters 1.3.0
    • collection 1.18.0
    • material_color_utilities 0.8.0
    • meta 1.12.0
    • vector_math 2.1.4
    • sky_engine any
  • firebase_storage 11.6.10
    • firebase_core ^2.27.1
    • firebase_core_platform_interface ^5.0.0
    • firebase_storage_platform_interface ^5.1.13
    • firebase_storage_web ^3.8.0
    • flutter any
  • firebase_ui_localizations 1.10.2
    • flutter any
    • flutter_localizations any
    • path ^1.8.3
  • firebase_ui_shared 1.4.1
    • flutter any
  • path 1.9.0
  • uuid 4.3.3
    • crypto ^3.0.0
    • sprintf ^7.0.0
    • meta ^1.10.0
    • fixnum ^1.1.0
  • file_selector 1.0.3
    • file_selector_android ^0.5.0
    • file_selector_ios ^0.5.0
    • file_selector_linux ^0.9.2
    • file_selector_macos ^0.9.3
    • file_selector_platform_interface ^2.6.0
    • file_selector_web ^0.9.1
    • file_selector_windows ^0.9.3
    • flutter any
  • flutter_blurhash 0.8.2
    • flutter any

dev dependencies:

  • flutter_test 0.0.0
    • flutter any
    • test_api 0.7.0
    • matcher 0.12.16+1
    • path 1.9.0
    • fake_async 1.3.1
    • clock 1.1.1
    • stack_trace 1.11.1
    • vector_math 2.1.4
    • leak_tracker_flutter_testing 3.0.3
    • async 2.11.0
    • boolean_selector 2.1.1
    • characters 1.3.0
    • collection 1.18.0
    • leak_tracker 10.0.4
    • leak_tracker_testing 3.0.1
    • material_color_utilities 0.8.0
    • meta 1.12.0
    • source_span 1.10.0
    • stream_channel 2.1.2
    • string_scanner 1.2.0
    • term_glyph 1.2.1
    • vm_service 14.1.0
  • flutter_lints 3.0.1
    • lints ^3.0.0
  • mockito 5.4.4
    • analyzer >=5.12.0 <7.0.0
    • build ^2.0.0
    • code_builder ^4.5.0
    • collection ^1.15.0
    • dart_style ^2.0.0
    • matcher ^0.12.15
    • meta ^1.3.0
    • path ^1.8.0
    • source_gen ^1.0.0
    • test_api >=0.2.1 <0.8.0

dependency overrides:

  • firebase_ui_localizations 1.10.2
    • flutter any
    • flutter_localizations any
    • path ^1.8.3
  • firebase_ui_shared 1.4.1
    • flutter any

transitive dependencies:

  • _fe_analyzer_shared 67.0.0
    • meta ^1.9.0
  • _flutterfire_internals 1.3.26
    • collection ^1.0.0
    • firebase_core ^2.27.1
    • firebase_core_platform_interface ^5.0.0
    • flutter any
    • meta ^1.8.0
  • analyzer 6.4.1
    • _fe_analyzer_shared ^67.0.0
    • collection ^1.17.0
    • convert ^3.0.0
    • crypto ^3.0.0
    • glob ^2.0.0
    • meta ^1.11.0
    • package_config ^2.0.0
    • path ^1.8.0
    • pub_semver ^2.1.4
    • source_span ^1.8.0
    • watcher ^1.1.0
    • yaml ^3.0.0
  • args 2.4.2
  • async 2.11.0
    • collection ^1.15.0
    • meta ^1.1.7
  • boolean_selector 2.1.1
    • source_span ^1.8.0
    • string_scanner ^1.1.0
  • build 2.4.1
    • analyzer >=1.5.0 <7.0.0
    • async ^2.5.0
    • convert ^3.0.0
    • crypto ^3.0.0
    • glob ^2.0.0
    • logging ^1.0.0
    • meta ^1.3.0
    • package_config ^2.1.0
    • path ^1.8.0
  • built_collection 5.1.1
  • built_value 8.9.1
    • built_collection ^5.0.0
    • collection ^1.15.0
    • fixnum ^1.0.0
    • meta ^1.3.0
  • characters 1.3.0
  • clock 1.1.1
  • code_builder 4.10.0
    • built_collection ^5.0.0
    • built_value ^8.0.0
    • collection ^1.15.0
    • matcher ^0.12.10
    • meta ^1.3.0
  • collection 1.18.0
  • convert 3.1.1
    • typed_data ^1.3.0
  • cross_file 0.3.4+1
    • meta ^1.3.0
    • web ^0.5.0
  • crypto 3.0.3
    • typed_data ^1.3.0
  • dart_style 2.3.6
    • analyzer ^6.2.0
    • args >=1.0.0 <3.0.0
    • collection ^1.17.0
    • path ^1.0.0
    • pub_semver >=1.4.4 <3.0.0
    • source_span ^1.4.0
  • fake_async 1.3.1
    • clock ^1.1.0
    • collection ^1.15.0
  • file 7.0.0
    • meta ^1.9.1
    • path ^1.8.3
  • file_selector_android 0.5.0+7
    • file_selector_platform_interface ^2.5.0
    • flutter any
    • plugin_platform_interface ^2.1.7
  • file_selector_ios 0.5.1+8
    • file_selector_platform_interface ^2.3.0
    • flutter any
  • file_selector_linux 0.9.2+1
    • cross_file ^0.3.1
    • file_selector_platform_interface ^2.6.0
    • flutter any
  • file_selector_macos 0.9.3+3
    • cross_file ^0.3.1
    • file_selector_platform_interface ^2.6.0
    • flutter any
  • file_selector_platform_interface 2.6.2
    • cross_file ^0.3.0
    • flutter any
    • http >=0.13.0 <2.0.0
    • plugin_platform_interface ^2.1.7
  • file_selector_web 0.9.4+1
    • file_selector_platform_interface ^2.6.0
    • flutter any
    • flutter_web_plugins any
    • web ^0.5.0
  • file_selector_windows 0.9.3+1
    • cross_file ^0.3.1
    • file_selector_platform_interface ^2.6.0
    • flutter any
  • firebase_core 2.27.1
    • firebase_core_platform_interface ^5.0.0
    • firebase_core_web ^2.12.0
    • flutter any
    • meta ^1.8.0
  • firebase_core_platform_interface 5.0.0
    • collection ^1.0.0
    • flutter any
    • flutter_test any
    • meta ^1.8.0
    • plugin_platform_interface ^2.1.3
  • firebase_core_web 2.12.0
    • firebase_core_platform_interface ^5.0.0
    • flutter any
    • flutter_web_plugins any
    • js ^0.6.3
    • meta ^1.8.0
    • web ^0.5.1
  • firebase_storage_platform_interface 5.1.13
    • _flutterfire_internals ^1.3.26
    • collection ^1.15.0
    • firebase_core ^2.27.1
    • flutter any
    • meta ^1.8.0
    • plugin_platform_interface ^2.1.3
  • firebase_storage_web 3.8.0
    • _flutterfire_internals ^1.3.26
    • async ^2.5.0
    • firebase_core ^2.27.1
    • firebase_core_web ^2.12.0
    • firebase_storage_platform_interface ^5.1.13
    • flutter any
    • flutter_web_plugins any
    • http >=0.13.0 <2.0.0
    • js ^0.6.3
    • meta ^1.8.0
    • web ^0.5.1
  • fixnum 1.1.0
  • flutter_localizations 0.0.0
    • flutter any
    • intl 0.18.1
    • characters 1.3.0
    • clock 1.1.1
    • collection 1.18.0
    • material_color_utilities 0.8.0
    • meta 1.12.0
    • path 1.9.0
    • vector_math 2.1.4
  • flutter_web_plugins 0.0.0
    • flutter any
    • characters 1.3.0
    • collection 1.18.0
    • material_color_utilities 0.8.0
    • meta 1.12.0
    • vector_math 2.1.4
  • glob 2.1.2
    • async ^2.5.0
    • collection ^1.15.0
    • file >=6.1.3 <8.0.0
    • path ^1.8.0
    • string_scanner ^1.1.0
  • http 1.2.1
    • async ^2.5.0
    • http_parser ^4.0.0
    • meta ^1.3.0
    • web ^0.5.0
  • http_parser 4.0.2
    • collection ^1.15.0
    • source_span ^1.8.0
    • string_scanner ^1.1.0
    • typed_data ^1.3.0
  • intl 0.18.1
    • clock ^1.1.0
    • meta ^1.0.2
    • path ^1.8.0
  • js 0.6.7
    • meta ^1.7.0
  • leak_tracker 10.0.4
    • clock ^1.1.1
    • collection ^1.15.0
    • meta ^1.8.0
    • path ^1.8.3
    • vm_service >=11.10.0 <15.0.0
  • leak_tracker_flutter_testing 3.0.3
    • flutter any
    • leak_tracker >=10.0.4 <11.0.0
    • leak_tracker_testing >=3.0.1 <4.0.0
    • matcher ^0.12.16
    • meta ^1.8.0
  • leak_tracker_testing 3.0.1
    • leak_tracker >=9.0.0 <11.0.0
    • matcher ^0.12.16
    • meta ^1.11.0
  • lints 3.0.0
  • logging 1.2.0
  • matcher 0.12.16+1
    • async ^2.10.0
    • meta ^1.8.0
    • stack_trace ^1.10.0
    • term_glyph ^1.2.0
    • test_api >=0.5.0 <0.8.0
  • material_color_utilities 0.8.0
    • collection ^1.15.0
  • meta 1.12.0
  • package_config 2.1.0
    • path ^1.8.0
  • plugin_platform_interface 2.1.8
    • meta ^1.3.0
  • pub_semver 2.1.4
    • collection ^1.15.0
    • meta ^1.3.0
  • sky_engine 0.0.99
  • source_gen 1.5.0
    • analyzer >=5.2.0 <7.0.0
    • async ^2.5.0
    • build ^2.1.0
    • dart_style ^2.0.0
    • glob ^2.0.0
    • path ^1.8.0
    • source_span ^1.8.0
    • yaml ^3.0.0
  • source_span 1.10.0
    • collection ^1.15.0
    • path ^1.8.0
    • term_glyph ^1.2.0
  • sprintf 7.0.0
  • stack_trace 1.11.1
    • path ^1.8.0
  • stream_channel 2.1.2
    • async ^2.5.0
  • string_scanner 1.2.0
    • source_span ^1.8.0
  • term_glyph 1.2.1
  • test_api 0.7.0
    • async ^2.5.0
    • boolean_selector ^2.1.0
    • collection ^1.15.0
    • meta ^1.3.0
    • source_span ^1.8.0
    • stack_trace ^1.10.0
    • stream_channel ^2.1.0
    • string_scanner ^1.1.0
    • term_glyph ^1.2.0
  • typed_data 1.3.2
    • collection ^1.15.0
  • vector_math 2.1.4
  • vm_service 14.1.0
  • watcher 1.1.0
    • async ^2.5.0
    • path ^1.8.0
  • web 0.5.1
  • yaml 3.1.2
    • collection ^1.15.0
    • source_span ^1.8.0
    • string_scanner ^1.1.0

Steps to reproduce

  1. Clone/Setup FirebaseUI-Flutter
  2. Run firebase_ui_storage example
  3. Upload img/file via UploadButton
  4. 'package:firebase_storage/src/reference.dart': Failed assertion: line 127 pos 12: 'file.absolute.existsSync()': is not true.

Expected Behavior

For the upload to go through/file to exist

Actual Behavior

Error:

┌──────────────────────────────────────────────────────────────────────────────
│ 'package:firebase_storage/src/reference.dart': Failed assertion: line 127 pos 12: 'file.absolute.existsSync()': is not true.
├┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄
│ #0   _AssertionError._doThrowNew (dart:core-patch/errors_patch.dart:51:61)
│ #1   _AssertionError._throwNew (dart:core-patch/errors_patch.dart:40:5)
│ #2   Reference.putFile (package:firebase_storage/src/reference.dart:127:12)
│ #3   _UploadButtonState._upload (package:firebase_ui_storage/src/widgets/upload_button.dart:88:20)
│ #4   <asynchronous suspension>
├┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄┄

@firebase_storage:

  /// Upload a [File] from the filesystem. The file must exist.
  ///
  /// Optionally, you can also set metadata onto the uploaded object.
  UploadTask putFile(File file, [SettableMetadata? metadata]) {
    assert(file.absolute.existsSync()); //<---
    return UploadTask._(storage, _delegate.putFile(file, metadata));
  }

@UploadButton:

...
Future<void> _upload(FirebaseUIStorageConfiguration config) async {
    try {
      setState(() {
        isLoading = true;
      });

      final file = await filePicker.pickFile();
      if (file == null) return;

      final childRef = config.namingPolicy.getUploadFileName(file.name);
      final ref = config.uploadRoot.child(childRef);

      UploadTask task;

      if (!kIsWeb) {
        print('Uploading file: ${file.path}'); //  file.path = content://com.android.providers.media.documents/document/image%3A1000000029
        task = ref.putFile(File(file.path));
      } else {
        task = ref.putData(await file.readAsBytes(), widget.metadata);
      }
...

Additional Information

No response

@russellwheatley russellwheatley added storage bug Something isn't working labels Apr 12, 2024
@russellwheatley
Copy link
Member

russellwheatley commented Apr 12, 2024

Reproduced, I've opened a bug report on flutter repo: flutter/flutter#146690

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
blocked: flutter bug Something isn't working storage
Projects
None yet
Development

No branches or pull requests

2 participants