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

bug: Android. Big files are not processed #401

Closed
5 of 31 tasks
de-dan opened this issue Jan 26, 2025 · 1 comment
Closed
5 of 31 tasks

bug: Android. Big files are not processed #401

de-dan opened this issue Jan 26, 2025 · 1 comment
Labels

Comments

@de-dan
Copy link

de-dan commented Jan 26, 2025

Plugin(s)

  • Android Foreground Service
  • Android Battery Optimization
  • App Review
  • App Shortcuts
  • App Update
  • Background Task
  • Badge
  • Bluetooth Low Energy
  • Cloudinary
  • Datetime Picker
  • File Compressor
  • File Opener
  • File Picker
  • Live Update
  • Managed Configurations
  • NFC
  • Photo Editor
  • Posthog
  • Printer
  • Screen Orientation
  • Screenshot
  • Speech Recognition
  • Speech Synthesis
  • Torch
  • Zip

Version

6.2.0

Platform(s)

  • Android
  • iOS
  • Web

Current behavior

Hey,

while small files are working fine, when I select a big file (>~50MB) on Android, the plugin does not proceed.

The File picking overlay is showing up and I select a big file from the Downloads folder on my Android Simulator (Pixel 4 API 33 (emulator) (Pixel_4_API_33)). The overlay disappears and I'm back in my app. But there is no processing, no positive (sucess) or negative (error) outcome.

I tried with several file types, .mov, .csv, .pdf. My assumption is, as soon as the file exceeds a certain threshold file size, the plugin is not working. I added a link in the README of the reproduction repository for a file that is not working.

Current result: No event, no error, no feedback from the plugin

Expected behavior

Expected result: FilePicker retrieves data and calls its callback function, whether with file data (success) or with an error message.

Reproduction

https://github.com/de-dan/filepickerissue

Steps to reproduce

Run this capacitor app on an android device
Pick a big file (I wasn't able to narrow it down) I used sample_1920x1080.mov from https://filesamples.com/formats/mov

Other information

No response

Capacitor doctor

💊 Capacitor Doctor 💊

Latest Dependencies:

@capacitor/cli: 7.0.1
@capacitor/core: 7.0.1
@capacitor/android: 7.0.1
@capacitor/ios: 7.0.1

Installed Dependencies:

@capacitor/ios: not installed
@capacitor/core: 6.2.0
@capacitor/cli: 6.2.0
@capacitor/android: 6.2.0

Before submitting

  • I have read and followed the bug report guidelines.
  • I have attached links to possibly related issues and discussions.
  • I understand that incomplete issues (e.g. without reproduction) are closed.
@de-dan de-dan added bug/fix Something isn't working needs: triage labels Jan 26, 2025
@robingenz
Copy link
Member

Yes, this is the expected behavior for large files if you set the readData option to true. The reason is that the file is loaded into memory as a base64 string and the available amount of memory is limited. This then leads to a crash. You should set the readData option to false. Feel free to take a look at our File Handling Guide for Capacitor for more information.

@robingenz robingenz closed this as not planned Won't fix, can't repro, duplicate, stale Jan 26, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants