dropbox / dropbox/SwiftyDropbox

Huge binary size overhead (~9.0MB) when integrating SwiftyDropbox

Open
#453 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Swift
Stars
721
Forks
218
PR merge metrics
No merged PRs in 30d

Description

**### Is your feature request related to a problem? Please describe.**
Yes, the current SDK size is prohibitively large for lightweight iOS applications.

I conducted a clean experiment to measure the impact of `SwiftyDropbox` on the final binary size:

1. Created a fresh, empty Xcode project.
2. Archived and exported the IPA (App Store Connect distribution).
3. **Result without SDK:** ~95 KB.
4. Added `SwiftyDropbox` (via SPM), initialized a basic `DropboxClient`, and archived again.
5. **Result with SDK:** **~9.5 MB**.

An overhead of **~9.4 MB** just for adding the capability to interact with Dropbox is excessive. Even with `Dead Code Stripping` and `Whole Module Optimization` enabled in Release mode (and `-Osize`), the SDK seems to pull in the entire dependency tree.

It appears that `DropboxClient` initializes all namespace routes (Files, Sharing, Users, Paper, Team, etc.) by default, creating hard references that prevent the Swift Linker from stripping unused modules.

**### Describe the solution you'd like**
I would like to see a modular approach to the SDK distribution.

Ideally, I should be able to import only the modules I need via SPM. For example:

* `SwiftyDropboxCore` (Auth + Networking)
* `SwiftyDropboxFiles` (File operations)

If I only need to log in and download files, I should not be forced to include code for `Paper`, `Team`, or `Business` APIs in my app bundle.

**### Describe alternatives you've considered**
Due to this size issue, I am forced to **remove SwiftyDropbox entirely** from my project.

I am currently switching to a manual implementation using:

* `ASWebAuthenticationSession` for OAuth 2.0.
* Native `URLSession` for REST API calls.

This is a significant downgrade in developer experience, but necessary because I cannot justify adding nearly 10MB to my app for just 3 basic features (Login, List Folder, Download).

**### Additional context**

* **App:** [[Anywhere Music Player](https://apps.apple.com/us/app/anywhere-music-player/id1669824656)](https://apps.apple.com/us/app/anywhere-music-player/id1669824656) (A lightweight music player).
* **Integration:** Swift Package Manager (SPM).
* **Xcode Version:** 26.x

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.