sign android apk with existing .keystore

[英]sign android apk with existing .keystore


I'm using Eclipse, and except for the default keystore path specified in windows->preferences->android->build, I didn't specify any other customized keystore path in eclipse.

我正在使用Eclipse,除了在windows-> preferences-> android-> build中指定的默认密钥库路径之外,我没有在eclipse中指定任何其他自定义密钥库路径。

I have the debug.keystore in two locations. one is in the default path, and the other say c:\customised_path. however, when i wanted to generate the cert:

我在两个位置有debug.keystore。一个是默认路径,另一个是c:\ customised_pa​​th。但是,当我想要生成证书时:

keytool -genkey -v -keystore debug.keystore -alias androiddebugkey -keyalg RSA -keysize 2048 -validity 20000 it'll generate the debug.keystore in the java\bin folder.

keytool -genkey -v -keystore debug.keystore -alias androiddebugkey -keyalg RSA -keysize 2048 -validity 20000它将在java \ bin文件夹中生成debug.keystore。

and if i try:

如果我尝试:

C:\Java\jdk1.6.0_25\bin>keytool -genkey -v -keystore C:\default_path\.android\d
ebug.keystore
keytool error: java.io.IOException: Invalid keystore format
java.io.IOException: Invalid keystore format
        at sun.security.provider.JavaKeyStore.engineLoad(JavaKeyStore.java:633)
        at sun.security.provider.JavaKeyStore$JKS.engineLoad(JavaKeyStore.java:3
8)
        at java.security.KeyStore.load(KeyStore.java:1185)
        at sun.security.tools.KeyTool.doCommands(KeyTool.java:620)
        at sun.security.tools.KeyTool.run(KeyTool.java:172)
        at sun.security.tools.KeyTool.main(KeyTool.java:166)

it'll gimme the same error to generate the key in the customized path too.

它也会产生相同的错误,以便在自定义路径中生成密钥。

i have debug.keystore in both folders still i'll have this:

我在两个文件夹中都有debug.keystore我仍然会这样:

C:\Java\jdk1.6.0_25\bin>keytool -list
keytool error: java.lang.Exception: Keystore file does not exist: C:\customiesed_path\.keystore

and C:\Java\jdk1.6.0_25\bin>keytool -list -keystore C:\the_default_path_specified_in_eclipse.keystore keytool error: java.lang.Exception: Keystore file does not exist: C:\default_path

和C:\ Java \ jdk1.6.0_25 \ bin> keytool -list -keystore C:\ the_default_path_specified_in_eclipse.keystore keytool错误:java.lang.Exception:密钥库文件不存在:C:\ default_path

Eclipse is using the .keystore in the default folder to sign the apk, and i have the .keystore in the default folder, but it just doesn't allow me to sign it and gives me annoying error when I try to run my application.

Eclipse使用默认文件夹中的.keystore来签署apk,我在默认文件夹中有.keystore,但它只是不允许我签名并在我尝试运行我的应用程序时给出了恼人的错误。

Could somebody help here please?

请问有人帮忙吗?

1 个解决方案

#1


0  

Bingo! problem solved! it seems that the .keystore is somehow changed and after I re-download it, it works again.

答对了!问题解决了!似乎.keystore以某种方式被更改,并且在我重新下载之后,它再次起作用。

I re-downloaded the .keystore that I need to use and run eclipse again. Now everything works normal. So next time someone has problems generating apk file using an existing key, please take into consideration "run" in eclipse not from cmd as well as download a new keystore.

我重新下载了我需要使用的.keystore并再次运行eclipse。现在一切正常了。因此,下次有人使用现有密钥生成apk文件时出现问题,请考虑eclipse中的“run”而不是cmd以及下载新的密钥库。

One more thing: signing in debug mode is different from release mode! Eclipse uses "run" to sign in debug mode. Using command line won't work because they're simply for release.

还有一件事:签名调试模式与发布模式不同! Eclipse使用“run”登录调试模式。使用命令行不起作用,因为它们只是用于发布。

智能推荐

注意!

本站翻译的文章,版权归属于本站,未经许可禁止转摘,转摘请注明本文地址:http://www.itdaan.com/blog/2011/12/22/4ca9b70561428587850a0d5c18a214ef.html



 
© 2014-2019 ITdaan.com 粤ICP备14056181号  

赞助商广告