kesha-antonov / react-native-background-downloader

About A library for React-Native to help you download large files on iOS and Android both in the foreground and most importantly in the background.
https://www.npmjs.com/package/@kesha-antonov/react-native-background-downloader
Other
26 stars 3 forks source link

Downloads over 2GB breaking on android, seems fine on iOS #17

Open sjchristi opened 2 weeks ago

sjchristi commented 2 weeks ago

Is this a bug report, a feature request, or a question?

Bug Report

Downloading files over 2GB does not work on any android device i've tested. iOS devices don't appear to have any issues. For Android devices in question, I've attempted to download these large files through chrome and the OS downoads them fine, so it doesn't appear to be a specific limit on file size in the OS. It's not clear to me if this is an issue with this library or with the fetch2 library -- https://github.com/tonyofrancis/Fetch -- but I have searched for issues in fetch and haven't seen anything pop up.

Have you followed the required steps before opening a bug report?

Is the bug specific to iOS or Android? Or can it be reproduced on both platforms?

Bug only happens on Android. Tested on a Samsung S23 using Android version 14.

Is the bug related to the native implementation? (NSURLSession on iOS and Fetch on Android)

I checked fetch and didn't notice any issues. I quickly checked and it does look like they are using 64-bit values for file sizes and not 32-bit values.

Environment

Environment: React: 18.2.0 React native: 0.72.11 react-native-background-downloader: 3.1.1

Target Platform: Android (13)

Expected Behavior

Expect that if the device file system doesn't have size limits of 2gb that we can download files over 2gb in size (on Android).

Actual Behavior

Downloads appear to start but never make any progress on android

Steps to Reproduce

Download a file greater than 2gb on android

sjchristi commented 2 weeks ago

Just ran into this PR; wondering if this fixes it: https://github.com/kesha-antonov/react-native-background-downloader/pull/7

Prashant13Pawar commented 2 weeks ago

I am also facing same issue . Downloading on android above 1GB file not working . Please provide a fix for this.

sjchristi commented 2 weeks ago

I tried switching to the source branch in PR #7: https://github.com/l3utterfly/react-native-background-downloader/tree/main

this fixed the issue for me. Tested again and users were able to download 6 gigabyte files