Somehow I could build android apps with Cordova on my machine but the APKs could not be installed, on both my mobile device and the PC Android Emulator Nox.
The problem persisted even when I tried with a fresh HelloWorld app:
cordova create testing
cd testing
cordova platform add android
cordova build android --release -- --gradleArg=-PcdvVersionCode=%ver%
zipalign -v -p 4 \testing\platforms\android\app\build\outputs\apk\release\app-release-unsigned.apk .\hw.apk
apksigner.bat sign --ks hw.keystore --ks-key-alias aladdin --ks-pass pass:xxxxxxxxx hw.apk
What could be the reason?
My problem was that I used the outdated apksigner instead of jarsigner.
This solved the problem:
jarsigner -verbose -sigalg SHA1withRSA -digestalg SHA1 -keystore <mykeystore> <PATH-TO-app-release-unsigned.apk> <appname-alias>