Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
App extensions include multiple copies of the Xamarin framework #5377
Steps to Reproduce
Should be comparable
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?
Example Project (If Possible)
ExtensionSamples provided by VSMac team was used.
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 ) 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.
 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).