Skip to content

Commit 3859e9c

Browse files
authored
Merge pull request #185 from winnerspiros/android-fix-apk-install-and-enable-aot-8727632183689944800
Fix Android APK installation and enable AOT
2 parents cbee50b + 7e03eaa commit 3859e9c

2 files changed

Lines changed: 15 additions & 6 deletions

File tree

.github/workflows/release.yml

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ jobs:
9292
- name: Build Android APK (signed)
9393
if: steps.keystore.outputs.has_keystore == 'true'
9494
run: >
95-
dotnet publish -c Release -p:AndroidKeyStore=false -p:PublishTrimmed=false -p:AndroidLinkMode=None
95+
dotnet publish -c Release
9696
osu.Android/osu.Android.csproj
9797
-f net10.0-android
9898
-p:Version=${{ steps.version.outputs.version }}
@@ -104,24 +104,33 @@ jobs:
104104
-p:AndroidSigningKeyPass=${{ secrets.ANDROID_SIGNING_KEY_PASSWORD }}
105105
-p:AndroidSigningStorePass=${{ secrets.ANDROID_SIGNING_STORE_PASSWORD }}
106106
107-
- name: Build Android APK (signed with default debug key)
107+
- name: Build Android APK (unsigned)
108108
if: steps.keystore.outputs.has_keystore != 'true'
109109
run: >
110-
dotnet publish -c Release -p:AndroidKeyStore=false -p:PublishTrimmed=false -p:AndroidLinkMode=None
110+
dotnet publish -c Release
111111
osu.Android/osu.Android.csproj
112112
-f net10.0-android
113113
-p:Version=${{ steps.version.outputs.version }}
114114
-p:ApplicationDisplayVersion=${{ steps.version.outputs.version }}
115115
-p:ApplicationVersion=${{ github.run_number }}
116+
-p:AndroidKeyStore=false
116117
117118
- name: Find APK
118119
id: find_apk
119120
run: |
120-
PUBLISH_DIR="osu.Android/bin/Release/net10.0-android"
121+
# The signed/final APK is inside the publish/ directory in net10.0-android
122+
PUBLISH_DIR="osu.Android/bin/Release/net10.0-android/publish"
121123
APK=$(find "$PUBLISH_DIR" -maxdepth 1 -name "*.apk" 2>/dev/null | head -1)
122124
if [ -z "$APK" ]; then
125+
# Fallback to the parent directory if publish/ doesn't exist for some reason
126+
PUBLISH_DIR="osu.Android/bin/Release/net10.0-android"
127+
APK=$(find "$PUBLISH_DIR" -maxdepth 1 -name "*.apk" 2>/dev/null | head -1)
128+
fi
129+
if [ -z "$APK" ]; then
130+
# Last resort: recursive find
123131
APK=$(find osu.Android/bin/Release -name "*.apk" | head -1)
124132
fi
133+
echo "Found APK at: $APK"
125134
echo "apk_path=$APK" >> "$GITHUB_OUTPUT"
126135
127136
- name: Upload APK artifact

osu.Android.props

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@
2121
Suppress trim analysis warnings because the project uses reflection extensively
2222
(Newtonsoft.Json, Realm, AutoMapper, RuntimeBinder). -->
2323
<PropertyGroup Condition="'$(Configuration)' == 'Release'">
24-
<RunAOTCompilation>false</RunAOTCompilation>
25-
<AndroidEnableProfiledAot>false</AndroidEnableProfiledAot>
24+
<RunAOTCompilation>true</RunAOTCompilation>
25+
<AndroidEnableProfiledAot>true</AndroidEnableProfiledAot>
2626
<SuppressTrimAnalysisWarnings>true</SuppressTrimAnalysisWarnings>
2727
<PublishTrimmed>false</PublishTrimmed>
2828
<AndroidLinkMode>None</AndroidLinkMode>

0 commit comments

Comments
 (0)