I have an Azure pipeline which has been building my MAUI app fine but a few weeks ago a problem occured. After the app is built and deployed for user download (in a custom online location, not the Google Play store), I try to install it manually on my few phones and every time it just says "Application cannot be installed", without any specific error details.
Interestingly enough, when I ‘run dotnet build MyApp.sln -c Release’ on my local machine, in the source folder, it builds the app just fine and I can then install it on all the phones without problems.
I have tried adding a signing step in the Azure pipeline and it seems to be working but the output apk still won’t install on phones.
The YAML code I added for signing the app (which didn’t help):
- task: AndroidSigning@3
displayName: 'Signing and aligning APK file(s) **/*.apk'
inputs:
apkFiles: '**/*.apk'
apksign: true
apksignerKeystoreFile: myappkey.keystore
apksignerKeystorePassword: mypass
apksignerKeystoreAlias: myappkey
apksignerKeyPassword: mypass
Any idea what I might be missing?
2
Answers
Turns out I was looking for the solution in the wrong place as it wasn't a problem with the YAML config.
I installed the app using android-adb to be able to see the logs and the exact error message. It turned out that I was trying to install a build generated by a different source (Azure instead of local machine) and needed to uninstall the old app first for that.
If I keep installing new versions of the app built on the same machine, I don't get the error anymore.
Based on my testing with the
dotnet publish
command for my MAUI application, the.apk
file generated during pipeline build can be installed manually, regardless of whether it is signed with the app key. I’m not certain if signing the package was a requirement when you built your app on your local machine. For your reference to build a signed app package in a pipeline, I have included a sample YAML definition below: