I am developping an app using Cordova, and there is something strange. The first test I made 3/4 weeks ago were ok and the debug apk was correctly installed on my phone. I have upgraded the code to comply with Android 12 (following the guide), and the build process is fine, but after installing it on my device (a Xiaomi Redmi) when I try to launch the app it tells me “App not installed”. The apk seems to be ok, because when I install it on a Huawei phone it works. Also the IOS build seems ok: this is a problem I only have on android-phone. The same issue is present with a Google Pixel.
I have already tryied a lot of things, permission to install from unknown source are ok on the phone so I don’t think the problem is with the phone.
I’ll leave here the log of the build, If anyone has any idea what could be the problem I would be very grateful!
Try deleting the old copy before installing the new one.
Just repeating this good advice.
I had the same problem and took me days to figure this out. Always delete/uninstall the old app before installing a new version.
Thank you for your answer. This not seems to be the problem: I already did it, and also trying to install the apk on a phone on which the app has never been installed gave the same problem.
I’m wondering, could it be a problem with the signing of the app? The app is already on the Google Play Store, and the build I have made is unsigned (in voltbuilder.json I did not change the androidAlias, androidAliasPassword, androidKeystore, androidKeystorePassword and did not include the keystore in certificates).
Otherwise I’d think the problem is with the apk being corrupted, but then why does it works fine on Huawei phones and not on “Google powered” one?
Signing is a good possibility. If your new version of the app has different credentials than the old one, it cannot delete the old one automatically.
Replying to anyone who could have a similar issue in the future.
In the end, I was able to succeed. The problem was “simple”: the latest version of one plugin I am using (OneSignal Cordova Plugin, for Push Notification) requires to set compileSdk = 33, so it requires android 13. Voltbuilder is able to create the apk which works correctly,but the phones I tryied were still in android 12. As soon as I upgraded the OS of my phone to the newer version (in my case, MIUI 13) the apk got installed correctly.
This means that probably the change from android 12 to android 13 could be a “breaking change” for some Cordova app. Nevertheless, the issue is solved for now: thank you to everyone who helped!
Thanks for posting the followup!