sentry-unity icon indicating copy to clipboard operation
sentry-unity copied to clipboard

libil2cpp.so file increased a lot in size, this expected?

Open hajimeku opened this issue 2 years ago • 5 comments
trafficstars

Environment

How do you use Sentry? Sentry Saas

Which version of the SDK? 0.26

How did you install the package? (Git-URL, Assetstore) Git-URL

Which version of Unity? 2021.3.10

Is this happening in Unity (editor) or on a player like Android, iOS, Windows? Android

Steps to Reproduce

Make an android build

Expected Result

Smaller build size

Actual Result

big build size

Any logs or screenshots

The left is a build without sentry, the right is with sentry image

hajimeku avatar Dec 15 '22 13:12 hajimeku

Thanks for pointing this out. I was definitely expecting an increase in size but not of this much. Unfortunately, we have to target netstandard2.0 which leads to quite a few dependencies. And I don't expect the aliasing we do on those dependencies to do us any favours either.

bitsandfoxes avatar Dec 16 '22 12:12 bitsandfoxes

Well, thats something we will have to deal with then. it's been amazing reporting some very difficult crashes so far. Keep it up.

hajimeku avatar Dec 16 '22 14:12 hajimeku

FYI @bitsandfoxes to track size increase (on PRs) we could use the "app binary size" metrics action from https://github.com/getsentry/action-app-sdk-overhead-metrics

Shouldn't be a big effort, it takes two APKs, one with and one without the SDK included. We would just need to reenable building the APK before Unity is added (we do that on the main branch only at the moment) and then grab those two APKs and pass it to the action. It will report the difference & also check how it changed from the main branch for a current PR. Without any more changes the action supports APKs and IPAs but for the app size metric, it would also be easy to add other platforms. Wouldn't go as far as adding support for app-startup metrics for more platforms at the moment.

vaind avatar Dec 20 '22 10:12 vaind

@vaind That is a valid issue but it will not reflect the actual impact on a production project. Targeting a different framework does increase the size but the majority will be stripped by unity if you dont reference all the api's.

hajimeku avatar Dec 20 '22 16:12 hajimeku

it will not reflect the actual impact on a production project

Fair point. But we could consider using our integration test project for this. Since it's actually using most parts of the SDK it should give a fairly good idea of the impact we're having on the app size.

bitsandfoxes avatar Jan 17 '23 11:01 bitsandfoxes

This issues goes into https://github.com/getsentry/sentry-unity/issues/2408

bitsandfoxes avatar Nov 11 '25 14:11 bitsandfoxes