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
[Xamarin.Android.Build.Tasks] copy all assembles to android/assets/shrunk
In the case where `$(AndroidLinkMode)` is not `None`, we run a
`<RemoveRegisterAttribute/>` to remove all `[Register]` attributes
from `Mono.Android.dll`. This is a step to save on APK size.
However, we found that the AOT compiler is seeing *two*
`Mono.Android.dll` files:
* obj\Debug\android\assets\Mono.Android.dll
* obj\Debug\android\assets\shrunk\Mono.Android.dll
@vargaz pointed out that this is bad, some of the AOT images will be
linked against the wrong one and fail to load at runtime. We could
possibly be silently falling back to the JIT...
I first attempted to just remove the `shrunk` directory and write
`Mono.Android.dll` *in place*. This idea didn't pan out:
dotnet#3925 (comment)
That idea broke incremental builds... So the next idea is to just copy
*every assembly* into the `android\assets\shrunk` directory. Then the
`AOT` compiler only operates against the `shrunk` directory.
This should only happen during `Release` builds, so the build
performance hit should be OK. We can also investigate removing
`[Register]` from *all* assemblies in a future PR, as that will likely
save further APK size from the support libraries, Google Play
Services, etc.
0 commit comments