Skip to content

Commit e5830b9

Browse files
Fix Android installation failure (INSTALL_PARSE_FAILED_NO_CERTIFICATES)
This commit addresses the .NET 10 Android regression causing "Attempt to get length of null array" during APK installation. Changes: - Strengthened the `FixRuntimePackAssetTypes` target in `osu.Android.props` to hook into `ComputeResolvedFilesToPublishList`, ensuring all native assets are correctly categorized as 'native' for the signing phase. - Updated `.github/workflows/release.yml` to use environment variables for signing secrets (`ALIAS`, `KEYPASS`, `STOREPASS`) to prevent shell expansion of special characters in passwords. - Enforced strict APK discovery in the release workflow by prioritizing the `publish/` directory and removing the unsafe fallback to `bin/Release/`, which often contained unsigned or malformed intermediates. - Verified that `android:extractNativeLibs="true"` and `targetSdkVersion="35"` are consistently applied across all `AndroidManifest.xml` files for .NET 10 stability.
1 parent bb26566 commit e5830b9

2 files changed

Lines changed: 15 additions & 15 deletions

File tree

.github/workflows/release.yml

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ name: Build Android APK
33
on:
44
push:
55
tags:
6-
- '*.*.*'
7-
- '!*-*'
6+
- "*.*.*"
7+
- "!*-*"
88
workflow_dispatch:
99

1010
jobs:
@@ -90,7 +90,11 @@ jobs:
9090
fi
9191
9292
- name: Build Android APK (signed)
93-
if: steps.keystore.outputs.has_keystore == 'true'
93+
if: steps.keystore.outputs.has_keystore == "true"
94+
env:
95+
ALIAS: ${{ secrets.ANDROID_SIGNING_KEY_ALIAS }}
96+
KEYPASS: ${{ secrets.ANDROID_SIGNING_KEY_PASSWORD }}
97+
STOREPASS: ${{ secrets.ANDROID_SIGNING_STORE_PASSWORD }}
9498
run: |
9599
dotnet publish -c Release \
96100
osu.Android/osu.Android.csproj \
@@ -100,12 +104,12 @@ jobs:
100104
-p:ApplicationVersion="${{ github.run_number }}" \
101105
-p:AndroidKeyStore="true" \
102106
-p:AndroidSigningKeyStore="${{ github.workspace }}/osu.Android/osu.keystore" \
103-
-p:AndroidSigningKeyAlias="${{ secrets.ANDROID_SIGNING_KEY_ALIAS }}" \
104-
-p:AndroidSigningKeyPass="${{ secrets.ANDROID_SIGNING_KEY_PASSWORD }}" \
105-
-p:AndroidSigningStorePass="${{ secrets.ANDROID_SIGNING_STORE_PASSWORD }}"
107+
-p:AndroidSigningKeyAlias="${ALIAS}" \
108+
-p:AndroidSigningKeyPass="${KEYPASS}" \
109+
-p:AndroidSigningStorePass="${STOREPASS}"
106110
107111
- name: Build Android APK (unsigned)
108-
if: steps.keystore.outputs.has_keystore != 'true'
112+
if: steps.keystore.outputs.has_keystore != "true"
109113
run: |
110114
dotnet publish -c Release \
111115
osu.Android/osu.Android.csproj \
@@ -124,12 +128,8 @@ jobs:
124128
APK=$(find "$PUBLISH_DIR" -maxdepth 1 -name "*.apk" 2>/dev/null | head -1)
125129
126130
if [ -z "$APK" ]; then
127-
echo "::warning::Signed APK not found in publish directory. Falling back to bin/Release (MAY BE UNSIGNED!)"
128-
APK=$(find osu.Android/bin/Release -name "*.apk" | head -1)
129-
fi
130-
131-
if [ -z "$APK" ]; then
132-
echo "::error::No APK found anywhere in bin/Release!"
131+
echo "::error::Signed APK not found in publish directory ($PUBLISH_DIR)!"
132+
# Use a non-restricted way to fail
133133
sh -c "false"
134134
fi
135135
@@ -144,7 +144,7 @@ jobs:
144144
if-no-files-found: error
145145

146146
- name: Create GitHub Release
147-
if: startsWith(github.ref, 'refs/tags/')
147+
if: startsWith(github.ref, "refs/tags/")
148148
uses: softprops/action-gh-release@v2
149149
with:
150150
files: ${{ steps.find_apk.outputs.apk_path }}

osu.Android.props

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
<DisableFody>true</DisableFody>
4343
</PropertyGroup>
4444

45-
<Target Name="FixRuntimePackAssetTypes" AfterTargets="ResolveRuntimePackAssets;ComputeFilesToPublish">
45+
<Target Name="FixRuntimePackAssetTypes" AfterTargets="ResolveRuntimePackAssets;ComputeFilesToPublish;ComputeResolvedFilesToPublishList">
4646
<ItemGroup>
4747
<RuntimePackAsset Update="@(RuntimePackAsset)" Condition="'%(Extension)' != '.dll'">
4848
<AssetType>native</AssetType>

0 commit comments

Comments
 (0)