release AAB violates Android 15 16KB page-alignment requirement (4.6.2)

When exporting a Godot 4.6.2 Mono/C# project as an Android App Bundle (AAB), the release build includes two Microsoft .NET CLR diagnostic native libraries that are not compiled with 16KB page alignment. This causes a failure in Android Studio’s App Bundle Explorer and will block Google Play submission for Android 15 (API 35+) devices.

Flagged libraries:

  • base/lib/arm64-v8a/libInstrumentationEngine.so (Microsoft CLR Instrumentation Engine)
  • base/lib/arm64-v8a/libCoverageInstrumentationMethod.so (.NET code coverage)

I have worked around it with edit to build.gradle to remove these files but that change will get wiped out if there is a new build template.

Is there some other way to exclude these files?

This is a report that should go in the Godot Github issue tracking system.

2 Likes

First check if it is a problem in 4.6.3

2 Likes

4.6.3 has the same issue. will raise in github

actually when I try to create a repo project it is ok. I tried deleting the android folder on my real project and re-importing build template, but the generated aab still reports the same issue.

I figured out the issue gdunit4 was the culprit.

I made this change to the csproj (<PrivateAssets>all</PrivateAssets>)

    <PackageReference Include="gdUnit4.analyzers" Version="1.0.0">
      <PrivateAssets>all</PrivateAssets>
      <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
    </PackageReference>

and added directory.build.targets to stop Microsoft.CodeCoverage causing the instrumentation files to get copied in

<Project>
  <!--
    Override Microsoft.CodeCoverage's CopyTraceDataCollectorArtifacts target, which
    copies ALL files from its build/ folder (including libInstrumentationEngine.so and
    libCoverageInstrumentationMethod.so) into the publish output via AfterTargets="ComputeFilesToPublish".
    These pre-built binaries lack 16KB page alignment required for Android 15+ (API 35).
    They are developer diagnostic tools with no role in a shipped Android application.
    Replacing the target with an empty body prevents them from appearing in the
    Android export's libs/release/arm64-v8a/ directory.
  -->
  <Target Name="CopyTraceDataCollectorArtifacts" AfterTargets="ComputeFilesToPublish">
    <!-- intentionally empty: suppresses non-16KB-aligned native libs from Android export -->
  </Target>
</Project>

Log a bug on the GDUnit4 GitHub. The maintainer is very responsive to tickets.

3 Likes