Home:ALL Converter>Unexpected parameter(s) after input APK (--out): Can't sign the apk for prod build

Unexpected parameter(s) after input APK (--out): Can't sign the apk for prod build

Ask Time:2022-06-09T06:04:05         Author:newbie

Json Formatter

I am trying to do a production build of an apk but when I try to sign it with the following command:

apksigner.bat sign --ks app-release-key.jks --out app-release-unsigned.apk app-release-unsigned-aligned.apk

I get the below error:

Unexpected parameter(s) after input APK (--out)

I am following this to sign the app manually from the command line.

I'm using the apksigner .bat file located at ../Android/Sdk/build-tools/32.0.0 and as you can see I'm using Android build tools 32.0.0. I've tried different things

  1. Using jarsigner to sign the app, and although it successfully signed the app, my app would not load when I installed it onto the device. Also, according to this we should use apksigner if we're using build-tools 24.0.3 and older.
  2. Tried to use this as well apksigner.bat sign --ks test.jks --ks-key-alias test --ks-pass pass:testtest --key-pass pass:testtest Test_Aligned.apk from here but it gave me the error Unexpected parameter(s) after input APK (--ks-key-alias)
  3. Tried using the jar apksigner located at ../Android/Sdk/build-tools/32.0.0/bin but I'm receiving the same error.

Any suggestions would help. Thanks.

Author:newbie,eproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/72552715/unexpected-parameters-after-input-apk-out-cant-sign-the-apk-for-prod-bui
yy