Skip to content

Commit f00700f

Browse files
Fix Android INSTALL_PARSE_FAILED_NO_CERTIFICATES regression
This commit restores critical .NET 10 Android build fixes that were lost in recent updates, resolving the "Attempt to get length of null array" error during APK certificate collection: 1. Re-add the 'FixRuntimePackAssetTypes' target to 'osu.Android.props' to correctly classify non-managed assets (native libraries) in the runtime pack. 2. Add 'android:extractNativeLibs="true"' to all Android manifest files to ensure native libraries are extracted, a required workaround for stable signature verification in .NET 10. 3. Revert 'targetSdkVersion' to 35 across all manifests to maintain stability on modern Android devices while avoiding experimental API 36 parsing issues. 4. Restore explicit 'Microsoft.CSharp' reference and rooting in 'osu.Android.props' to prevent trimmer-related build failures in Release/AOT configurations.
1 parent 4b7e6f6 commit f00700f

7 files changed

Lines changed: 39 additions & 12 deletions

File tree

osu.Android.props

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,18 +13,31 @@
1313
the patch in some build orderings. This suppression is harmless since we do fix them. -->
1414
<AndroidPageSize16KBCompatibilityCheck>false</AndroidPageSize16KBCompatibilityCheck>
1515
</PropertyGroup>
16+
1617
<!-- Patch NuGet-provided .so files that ship with 4 KB ELF alignment to 16 KB.
1718
See build/PatchElfPageSize.targets for details.
1819
TODO: Remove once ppy.Veldrid.SPIRV ships 16 KB-aligned native libraries. -->
1920
<Import Project="$(MSBuildThisFileDirectory)build\PatchElfPageSize.targets" />
21+
2022
<!-- Release-only optimisations: AOT for low-latency gameplay, trimming for smaller APK.
2123
Suppress trim analysis warnings because the project uses reflection extensively
2224
(Newtonsoft.Json, Realm, AutoMapper, RuntimeBinder). -->
2325
<PropertyGroup Condition="'$(Configuration)' == 'Release'">
2426
<RunAOTCompilation>true</RunAOTCompilation>
2527
<AndroidEnableProfiledAot>true</AndroidEnableProfiledAot>
2628
<SuppressTrimAnalysisWarnings>true</SuppressTrimAnalysisWarnings>
29+
<PublishTrimmed>true</PublishTrimmed>
30+
<TrimMode>partial</TrimMode>
2731
</PropertyGroup>
32+
33+
<ItemGroup Condition="'$(Configuration)' == 'Release'">
34+
<!-- Force Microsoft.CSharp into the trimmer input graph (.NET 10+). -->
35+
<!-- A bare TrimmerRootAssembly is ignored if the assembly is not in the -->
36+
<!-- linker's input set; adding this reference ensures it is included. -->
37+
<PackageReference Include="Microsoft.CSharp" Version="4.7.0" NoWarn="NU1510" />
38+
<TrimmerRootAssembly Include="Microsoft.CSharp" RootMode="all" />
39+
</ItemGroup>
40+
2841
<ItemGroup>
2942
<!-- IMPORTANT: ppy.osu.Framework.Android v2026.318.0 only ships net8.0-android34.0 assets.
3043
NuGet silently falls back to those assets when the app targets net10.0-android (API 36).
@@ -33,9 +46,23 @@
3346
TODO: Remove this comment once ppy.osu.Framework.Android ships net10.0-android assets. -->
3447
<PackageReference Include="ppy.osu.Framework.Android" Version="2026.318.0" />
3548
</ItemGroup>
49+
3650
<PropertyGroup>
3751
<!-- Fody does not handle Android build well, and warns when unchanged.
3852
Since Realm objects are not declared directly in Android projects, simply disable Fody. -->
3953
<DisableFody>true</DisableFody>
4054
</PropertyGroup>
55+
56+
<!-- Fix for .NET 10 Android AOT misclassifying non-managed assets in runtime pack.
57+
This is critical for Android 16 (API 36) which has stricter manifest/parsing rules. -->
58+
<Target Name="FixRuntimePackAssetTypes" AfterTargets="ResolveRuntimePackAssets;ComputeFilesToPublish;ComputeResolvedFilesToPublishList">
59+
<ItemGroup>
60+
<RuntimePackAsset Update="@(RuntimePackAsset)" Condition="'%(Extension)' != '.dll'">
61+
<AssetType>native</AssetType>
62+
</RuntimePackAsset>
63+
<ResolvedFileToPublish Update="@(ResolvedFileToPublish)" Condition="'%(Extension)' != '.dll'">
64+
<AssetType>native</AssetType>
65+
</ResolvedFileToPublish>
66+
</ItemGroup>
67+
</Target>
4168
</Project>

osu.Android/AndroidManifest.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?xml version='1.0' encoding='utf-8'?>
22
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="sh.ppy.osulazer" android:installLocation="auto">
3-
<uses-sdk android:minSdkVersion="33" android:targetSdkVersion="36" />
4-
<application android:allowBackup="true" android:supportsRtl="true" android:label="osu!" android:icon="@mipmap/ic_launcher" android:roundIcon="@mipmap/ic_launcher" android:largeHeap="true">
3+
<uses-sdk android:minSdkVersion="33" android:targetSdkVersion="35" />
4+
<application android:extractNativeLibs="true" android:allowBackup="true" android:supportsRtl="true" android:label="osu!" android:icon="@mipmap/ic_launcher" android:roundIcon="@mipmap/ic_launcher" android:largeHeap="true">
55
<provider android:name="androidx.core.content.FileProvider" android:authorities="sh.ppy.osulazer.fileprovider" android:grantUriPermissions="true" android:exported="false">
66
<meta-data android:name="android.support.FILE_PROVIDER_PATHS" android:resource="@xml/filepaths" />
77
</provider>
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<!-- using a different name because package name cannot contain 'catch' -->
33
<manifest xmlns:android="http://schemas.android.com/apk/res/android" android:versionCode="1" android:versionName="1.0" package="osu.Game.Rulesets.Catch_Tests.Android" android:installLocation="auto">
4-
<uses-sdk android:minSdkVersion="33" android:targetSdkVersion="36" />
5-
<application android:allowBackup="true" android:supportsRtl="true" android:label="osu!catch Test" />
4+
<uses-sdk android:minSdkVersion="33" android:targetSdkVersion="35" />
5+
<application android:extractNativeLibs="true" android:allowBackup="true" android:supportsRtl="true" android:label="osu!catch Test" />
66
</manifest>
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<manifest xmlns:android="http://schemas.android.com/apk/res/android" android:versionCode="1" android:versionName="1.0" package="osu.Game.Rulesets.Mania.Tests.Android" android:installLocation="auto">
3-
<uses-sdk android:minSdkVersion="33" android:targetSdkVersion="36" />
4-
<application android:allowBackup="true" android:supportsRtl="true" android:label="osu!mania Test" />
3+
<uses-sdk android:minSdkVersion="33" android:targetSdkVersion="35" />
4+
<application android:extractNativeLibs="true" android:allowBackup="true" android:supportsRtl="true" android:label="osu!mania Test" />
55
</manifest>
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<manifest xmlns:android="http://schemas.android.com/apk/res/android" android:versionCode="1" android:versionName="1.0" package="osu.Game.Rulesets.Osu.Tests.Android" android:installLocation="auto">
3-
<uses-sdk android:minSdkVersion="33" android:targetSdkVersion="36" />
4-
<application android:allowBackup="true" android:supportsRtl="true" android:label="osu!standard Test" />
3+
<uses-sdk android:minSdkVersion="33" android:targetSdkVersion="35" />
4+
<application android:extractNativeLibs="true" android:allowBackup="true" android:supportsRtl="true" android:label="osu!standard Test" />
55
</manifest>
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<manifest xmlns:android="http://schemas.android.com/apk/res/android" android:versionCode="1" android:versionName="1.0" package="osu.Game.Rulesets.Taiko.Tests.Android" android:installLocation="auto">
3-
<uses-sdk android:minSdkVersion="33" android:targetSdkVersion="36" />
4-
<application android:allowBackup="true" android:supportsRtl="true" android:label="osu!taiko Test" />
3+
<uses-sdk android:minSdkVersion="33" android:targetSdkVersion="35" />
4+
<application android:extractNativeLibs="true" android:allowBackup="true" android:supportsRtl="true" android:label="osu!taiko Test" />
55
</manifest>
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<manifest xmlns:android="http://schemas.android.com/apk/res/android" android:versionCode="1" android:versionName="1.0" package="osu.Game.Tests.Android" android:installLocation="auto">
3-
<uses-sdk android:minSdkVersion="33" android:targetSdkVersion="36" />
4-
<application android:allowBackup="true" android:supportsRtl="true" android:label="osu!visual Test" />
3+
<uses-sdk android:minSdkVersion="33" android:targetSdkVersion="35" />
4+
<application android:extractNativeLibs="true" android:allowBackup="true" android:supportsRtl="true" android:label="osu!visual Test" />
55
</manifest>

0 commit comments

Comments
 (0)