-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Realm on the Apple Watch with a Swift project is not feasible #5203
Comments
You're absolutely right. It'd be interesting to measure the binary size reduction from avoiding the sync components, as I've started in #4851. |
Thanks for the update. Looks like #4851 is on hold, do you have an ETA for it? |
No. |
Does the environment variable, REALM_DISABLE_SYNC=TRUE, work so I can at least test the theory to see how much we would save? |
No, there are major changes required to the build system to avoid adding sync components contribute to binary size. |
I'm curious how you've determined that Realm contributes 15MB to the application size. By my analysis, Realm should contribute 7MB. I found this figure by stripping out the simulator architecture and bitcode slice from the watchOS frameworks in our most recent release. That leaves me with a Realm.framework that's around 5.7MB and a RealmSwift.framework that's around 1.2MB. |
Bitcode is unfortunately counted in the size limit in iTunesConnect. |
That's hilarious, and makes no sense at all 😞 |
Sorry for the poor research, looks like this was already brought up a year ago Looks like Realm w/ Swift on the watch is not happening anytime soon. |
Is it worth putting something in the FAQ or elsewhere in the docs so that developers are aware about the issue? |
Ideally we'd add the rough numbers from the bitcode overhead to the size section of our FAQ, and point readers to a radar detailing how iTunesConnect shouldn't incorporate the bitcode weight in its size limit. @jlaws would you be interested in filing such a radar? |
FYI I am getting 18MB used by Realm/RealmSwift for submission to Apple. You will probably be better off with the radar, coming from a larger organization, but I can file one as well so they know more people are concerned about it. |
That's a bit surprising. My measurements indicate that
Past radars don't indicate that filers from Realm have had more success than filers from outside Realm. However, if you file one, I'd be happy to duplicate it if you cross-post it to Open Radar if you think it will help it get more visibility. |
Interestingly enough, if I attempt to measure the size of just the bitcode from Realm frameworks for the watchOS platform, I get closer to the 18MB figure you obtained.
Where |
I had been sneaking in just under the 50MB limit with Xcode 8 (I would get a warning on submission but it would pass) but after switching to Xcode 9 and updating the project to Swift 3.2 (no other changes) I can no longer submit my app (58MB). Is my only option to rewrite my watchOS app to work without Realm? |
From Apple (Sep 19, 2017):
|
I'm very happy to hear that Apple is finally making progress on that issue! |
Goals
Using Realm on the Apple Watch with a Swift project is not feasible. You are limited to 50MB for your watch bundle, with the system and all the Swift libraries taking up 30MB of that, then Realm adding another 15MB. This leaves ~5MB for the actual application, including all assets.
Expected Results
It would be great to have a lightweight version of Realm that uses less than 5MB of space in a bundle. Even if it was readonly and require a pre-populated Realm database file. Not sure what other functionality could be trimmed to reduce the code size.
The text was updated successfully, but these errors were encountered: