You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Remove references to the app extensions and rebuild
Observe the size of the resulting app bundle
Expected Behavior
Should be comparable
Actual Behavior
The final size of the app bundle with the extensions is almost 8x the bundle size without them
Note: In my case, in order to get a release build to succeed, I had to remove the ShareExtension project as I just couldn't get it to take my provisioning profile. The TodayExtension and FinderSyncExtension projects were fine with it. In this config, the app bundle size with the extensions was 23.9 MB. When I removed references to the two remaining extensions it was 3.1 MB - The two extensions increased the size by 770%. I should at least think the app would be the larger portion.
.Net does allow giving the runtime hints on where to look for binaries, so maybe this could be used. Clear any of the appex projects of the framework and assign a search path that points to the main bundle's MonoBundle folder?
Similar logic exists in Xamarin.iOS. It's a bit more tricky that it looks like since sharing implies most build options (e.g. AOT) must be identical (across all projects [1]) otherwise assemblies can't be reused.
Also deduplicating cannot work in a few other cases, e.g. using a different versions of a 3rd party library (which is more common that expected) between projects.
[1] if you see an 770% increase it's likely because the main app is linked and the extensions are not (which is also something, linking, that needs to be aware of code sharing across projects).
Not exactly a known workaround but, in theory, you could write a small script that detects duplicated files and replace them with symlinks.
This assume that all your build options are identical between your main application and all its extensions and that anything that modify assemblies, e.g. our managed linker, are disabled.
Note that such changes will break existing code signatures and that you'll need to re-sign everything (extensions and application) properly.
If you try this then please et us know your results :-)
Steps to Reproduce
Expected Behavior
Should be comparable
Actual Behavior
The final size of the app bundle with the extensions is almost 8x the bundle size without them
Note: In my case, in order to get a release build to succeed, I had to remove the ShareExtension project as I just couldn't get it to take my provisioning profile. The TodayExtension and FinderSyncExtension projects were fine with it. In this config, the app bundle size with the extensions was 23.9 MB. When I removed references to the two remaining extensions it was 3.1 MB - The two extensions increased the size by 770%. I should at least think the app would be the larger portion.
.Net does allow giving the runtime hints on where to look for binaries, so maybe this could be used. Clear any of the appex projects of the framework and assign a search path that points to the main bundle's MonoBundle folder?
Environment
Build Logs
https://gist.github.com/bocciab/17e73f6b50ab16b2ab88e5265f0a208f
Example Project (If Possible)
ExtensionSamples provided by VSMac team was used.
The text was updated successfully, but these errors were encountered: