Notice (2018-05-24): bugzilla.xamarin.com is now in
Please join us on
Visual Studio Developer Community and in the
Mono organizations on
GitHub to continue tracking issues. Bugzilla will remain
available for reference in read-only mode. We will continue to work
on open Bugzilla bugs, copy them to the new locations
as needed for follow-up, and add the new items under Related
Our sincere thanks to everyone who has contributed on this bug
tracker over the years. Thanks also for your understanding as we
make these adjustments and improvements for the future.
Please create a new report on
Developer Community or GitHub with
your current version information, steps to reproduce, and relevant error
messages or log files if you are hitting an issue that looks similar to
this resolved bug and you do not yet see a matching new report.
I'm noticing that my applications are really large in Xamarin (typically twice the size of the corresponding Java version). I believe that this is because dead code isn't eliminated in the JAR binding projects that I'm using.
I'm surprised that the code size is _only_ twice the size, given that the Mono runtime + (linked) class libraries are also included with your app...or are you looking at the Debug .apk size, not a Release .apk size?
What are you looking at for .apk sizes? :-)
> I believe that this is because dead code isn't eliminated in the
> JAR binding projects that I'm using.
This is correct. It's also rather complicated to support, as the Java member references will be coming from C# code, and thus "invisible" to proguard. If we use proguard "normally", ~everything Java would get removed, and the app would crash at startup.
It was more of an anecdotal example based on the size of the release apk and the size of the installed program on the device (which is much larger as well).
Couldn't you just link the C# and then as a separate step run proguard on just the Java portions and then link everything again? The first step would eliminate the dead C# from the bindings and then proguard would remove the unreferenced Java code. It wouldn't be exhaustive but for some of the larger jars it could help a lot.
While I had some early stage attempt to use proguard many months ago, it's too early to assign me on "not sure who is going to work on it in the far future" task.
Any update or ideas on how to do this? I found XamGuard but it doesn't work out of the box for me.
This is becoming a problem for me as distributing off the app store (to private customers for instance) is made more difficult by the increased file sizes.
We're on experimental phase to support it. This Xamarin Evolve 2014 LT slides explain how to use it.
Is there a plan to make this easier to use?
In the next non-maintenance version you will be able to enable Proguard on the IDEs.
Closing the bug as FIXED.