Skip to content

Commit 9d9996c

Browse files
sharpninjaCopilot
andcommitted
Fix Android project: add OutputType Exe for APK generation
Without OutputType=Exe, .NET treats the Android project as a library and produces an .aar instead of an .apk. Also improved APK search in the CI workflow with better diagnostics. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 260eaa7 commit 9d9996c

2 files changed

Lines changed: 10 additions & 2 deletions

File tree

.github/workflows/build-android.yml

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,9 +93,16 @@ jobs:
9393
- name: Find and rename APK
9494
id: find-apk
9595
run: |
96-
APK=$(find src/RequestTracker.Android/bin/Release -name "*.apk" | head -1)
96+
echo "=== All output files ==="
97+
find src/RequestTracker.Android/bin/Release -type f -name "*.apk" -o -name "*.aab" | sort
98+
echo "=== Searching for APK ==="
99+
# Search for signed APK first, then any APK
100+
APK=$(find src/RequestTracker.Android/bin/Release -name "*-Signed.apk" | head -1)
97101
if [ -z "$APK" ]; then
98-
echo "ERROR: No APK found!"
102+
APK=$(find src/RequestTracker.Android/bin/Release -name "*.apk" | head -1)
103+
fi
104+
if [ -z "$APK" ]; then
105+
echo "ERROR: No APK found! Full file listing:"
99106
find src/RequestTracker.Android/bin/Release -type f
100107
exit 1
101108
fi

src/RequestTracker.Android/RequestTracker.Android.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22
<PropertyGroup>
3+
<OutputType>Exe</OutputType>
34
<TargetFramework>net9.0-android</TargetFramework>
45
<Nullable>enable</Nullable>
56
<ApplicationId>com.requesttracker.android</ApplicationId>

0 commit comments

Comments
 (0)