Access denied when creating keystore for Android app

烂漫一生 提交于 2019-11-30 01:04:58

It does help you. You have to specify the location of the file that will be generated. For example specify C:\Documents and Settings\loginname\market.keystore

Sarker

Below steps worked for me:

  1. Run command prompt as administrator

  2. Unchecked the read only options in C:\Program Files\Java\jdk1.6.0_25\bin This may not be required

  3. keytool -genkey -v -keystore d:\my_private_key.keystore -alias my_key_alias -keyalg RSA -keysize 2048 -validity 10000

Tell it to create it in drive D:.

The keystore that the Android SDK needs access to is not the same of the JDK. You can simply use the "create new keystore" option of the Android wizard and choose any folder you have write access to: the wizard will create there a new keystore. You don't need to use keytool form JDK.

vivek

Access denied because you are not an admin.

Simply open the cmd prompt as an administrator - that worked for me.

arnaudweb

I had the same problem. You need to define your JAVA_HOME environment variable.

Read the "Basic Setup for signing" paragraph of this link : http://developer.android.com/guide/publishing/app-signing.html#setup

It says:

Before you begin, make sure that the Keytool utility and Jarsigner utility are available to the SDK build tools. Both of these tools are available in the JDK. In most cases, you can tell the SDK build tools how to find these utilities by setting your JAVA_HOME environment variable so it references a suitable JDK. Alternatively, you can add the JDK version of Keytool and Jarsigner to your PATH variable.

If you are developing on a version of Linux that originally came with GNU Compiler for Java, make sure that the system is using the JDK version of Keytool, rather than the gcj version. If Keytool is already in your PATH, it might be pointing to a symlink at /usr/bin/keytool. In this case, check the symlink target to be sure it points to the Keytool in the JDK.

Fixing the problem on win7 (yuk) without Eclipse: i have the environment variable JAVA_HOME set to ..../JDK1.7.0_03 (android programmed from GLbasic), and i did only 2 things to fix the problem: 1) in the folder ..../Java/JDK1.7.0_03 i removed the "read-only" permission of the /bin sub-folder, which contains keytool.exe. 2) i opened the console "as administrator" (although it's the only account on my win7). then you do cd...JDK / bin, run again keytool.exe, and you get the file nickname.keystore auto-generated in JDK / bin. Once everything is done you could re-assign the "read-only" permission. Good luck!

opening Command Prompt as a Administrator helped me.(For Windows 8.1)

chagning read only on windows 7 helped me. don't forget the default password "changeit"

Jimmy

If you are using Windows 7, make sure you are running eclipse as an administrator.

Make sure there is no other keystore file at this location C:\Program Files\Java\jdk1.6.0_25\bin. If there is, keep it somewhere else and try the command again:

keytool -genkey -v -keystore d:\my_private_key.keystore -alias my_key_alias -keyalg RSA -keysize 2048 -validity 10000

Seems that it's easier to accomplish it in command line via keytool and the latest genkeypair approach. I finished up with the following:

keytool -genkeypair -keystore ~/.android/release.keystore -alias <my_alias> -storepass <my_cert_pass> -keyalg RSA

Then I got a set of questions regarding name, organization, location and password for my alias and that was it!

Yusuf Adeyemo

Running eclipse as administrator solve the problem, then type the following:

keytool -genkey -v -keystore NAME-mobileapps.keystore -alias NAMEmobileapps -keyalg RSA -keysize 2048 -validity 10000

Hope it help?

If you are on Mac, Add "sudo" at the beginning of your command "keytool -genkey -v -keystore my-release-key.keystore -alias my-key-alias -keyalg RSA -keysize 2048 -validity 10000"

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!