Skip to content

Archiving apk using .net 7.0+ for android includes wrong platforms #8165

Closed as not planned
@jfversluis

Description

@jfversluis

Issue moved from dotnet/maui#15971


From @mosammo on Monday, July 3, 2023 9:04:33 AM

Description

[severity:I’m unable to use this version]
Archiving apk using .net 7.0 for android with “Target platform” “ARM64” produces large apk that includes assemblies of other platforms “X86” and “x64” which increases apk size considerably.

Expected behavior is to only include assemblies of the selected target platform. For example if we select “ARM32” it should not include other platforms like “ARM64”, “X86” and “x64”.

Latest visual studio 2022 17.6.2

Steps to Reproduce

simple steps:

  1. Create a maui project.
  2. Right click the project to select the properties change Target platform to “ARM64” under Build->General
  3. Build the project then archive apk.

To check it simply rename the apk as .zip file then open it and check folders “assemblies” and “bin” inside the apk. (please check attached screenshots)

Link to public reproduction project repository

https://github.com/mosammo/DotNetIssues

Version with bug

7.0.49

Last version that worked well

6.0

Affected platforms

Android

Affected platform versions

.net 7 for android

Did you find any workaround?

no

Relevant log output

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    need-attentionA xamarin-android contributor needs to reviewneeds-triageIssues that need to be assigned.vs-syncFor internal use only; creates a VSTS "mirror" issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions