相关文章推荐
傲视众生的山寨机  ·  Use the XAML code ...·  3 周前    · 
温文尔雅的番茄  ·  npm install之cannot ...·  1 年前    · 
犯傻的芹菜  ·  Random error ...·  1 年前    · 
逆袭的签字笔  ·  C# ...·  1 年前    · 

I am following this article to manually sign an .apk. After zipalign issued the following command:

apksigner sign --ks <my-keystore> --ks-key-alias <my-alias> <my-package-name>.apk

But I am getting the following error after entering the Keystore password:

Keystore password for signer #1:
Failed to load signer "signer #1"
java.io.FileNotFoundException: esm.keystore (The system cannot find the file specified)
at java.io.FileInputStream.open0(Native Method)
at java.io.FileInputStream.open(FileInputStream.java:195)
at java.io.FileInputStream.<init>(FileInputStream.java:138)
at java.io.FileInputStream.<init>(FileInputStream.java:93)
at com.android.apksigner.SignerParams.loadKeyStoreFromFile(SignerParams.java:352)
at com.android.apksigner.SignerParams.loadPrivateKeyAndCertsFromKeyStore(SignerParams.java:239)
at com.android.apksigner.SignerParams.loadPrivateKeyAndCerts(SignerParams.java:181)
at com.android.apksigner.ApkSignerTool.sign(ApkSignerTool.java:277)
at com.android.apksigner.ApkSignerTool.main(ApkSignerTool.java:83)

I think the apksigner asks the password prior to locating the file to use it on.
Tried the absolute path yet?

apksigner sign --ks "C:\Users\shant\AppData\Local\Xamarin\Mono for Android\Keystore\esm.keystore" --ks-key-alias <my-alias> <my-package-name>.apk

@Shantimohan Elchuri , if your keystore file is correctly spelled, it may be that it is not found at the expected location from where you execute the command. Try to run the command at the root of your project and use a relative path to where the file is located like;

apksigner sign --ks ".\YourKeyStoreFileLocation\esm.keystore" --ks-key-alias <my-alias> <my-package-name>.apk

Let me know if this helped.

The keystore is in:

C:\Users\shant\AppData\Local\Xamarin\Mono for Android\Keystore\esm.keystore

I am running the apksigner command from the directory, where the apk is situated:

<my-project>\Android\Release\bin\com.<my-company>.<my-app>.apk

If it can't find the esm.keystore, then how come it is asking for the password? Isn't password embedded in the keystore file?

I just repeated what I did a month ago without any errors. That's what is perplexing me.