Skip to content

Use --output-pinvokes feature to remove extra .so files from apps #7114

Description

@jonathanpeppers

Android application type

Android for .NET (net6.0-android, etc.)

Affected platform version

.NET 6+

Description

Context: dotnet/linker#2853 (comment)

If you dotnet new android and then build with -c Release, you get an .apk with a couple extra native libraries:

image

In this case, we don't think the app actually needs libSystem.IO.Compression.Native.so or libSystem.Security.Cryptography.Android.Native.so.

We think it might be possible to use --output-pinvokes and completely drop certain .so files from projects.

Steps to Reproduce

  1. dotnet new android
  2. dotnet build -c Release

Did you find any workaround?

No response

Relevant log output

No response

Metadata

Metadata

Labels

Area: App+Library BuildIssues when building Library projects or Application projects.enhancementProposed change to current functionality.

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions