简体   繁体   English

如何在intelliJ中生成签名的APK

[英]How to generate a signed APK in intelliJ

I wonder how to get a certificate and sign the apk in intelliJ 13 ( Win 7 x64 ). 我不知道如何获取证书并在intelliJ 13Win 7 x64 )中对apk进行intelliJ 13 I followed a tutorial about Generating a new release key at: 我遵循了有关生成新发行密钥的教程,网址为:

http://www.jetbrains.com/idea/webhelp/generating-a-signed-apk-using-a-wizard.html http://www.jetbrains.com/idea/webhelp/generating-a-signed-apk-using-a-wizard.html

I tried to create a new keystore and fill in required info, but encounter the following error: 我试图创建一个新的密钥库并填写所需的信息,但是遇到以下错误:

keytool error: java.lang.Exception: Keystore file exists, but is empty: 'path name'

Path name is the location that I store my keys, but is empty, as I expect intelliJ to generate a new key and store that key in the location. 路径名是我存储密钥的位置,但为空,因为我希望智能生成一个新密钥并将该密钥存储在该位置。 I wonder is there a streamline method to generate a key and sign the app automatically provided required information. 我想知道是否有一种简化的方法来生成密钥并自动为应用提供的必需信息签名。

The workaround is simply adding a file name ( *.jks ) after the path name selected from the folder tree. 解决方法是在从文件夹树中选择的路径名后添加文件名( *.jks )。

I'm thinking this is what's happening: 我在想这是怎么回事:

If Keytool is already in your PATH, it might be pointing to a symlink at /usr/bin/keytool. 如果Keytool已经在您的PATH中,则它可能指向/ usr / bin / keytool上的符号链接。 In this case, check the symlink target to be sure it points to the Keytool in the JDK. 在这种情况下,请检查符号链接目标,以确保它指向JDK中的Keytool。 [source] [资源]

If the symlink does point to the right location of your keytool, then the next thing I would attempt is to try signing the application manually through the command line. 如果符号链接确实指向键盘工具的正确位置,那么我接下来要尝试的是尝试通过命令行手动签名应用程序。 This is to eliminate IntelliJ as a possible cause of your problem. 这是为了消除可能导致问题的IntelliJ。 Once you're able to sign your key with the command line, then you can delete the key and try again with intelliJ. 一旦可以使用命令行对密钥进行签名,就可以删除密钥,然后使用intelliJ再试一次。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM