无法重新创建缺少的调试密钥存储区? [英] Unable to recreate missing debug keystore?

查看:170
本文介绍了无法重新创建缺少的调试密钥存储区?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是Android中编程的新手,我只是试图运行我的构建,并得到这个消息。

 执行失败的任务':app:validateDebugSigning'。 
>无法重新创建缺失的调试密钥库。

这是什么意思?我正在使用Android Studio。

解决方案

我刚刚解决了同样的问题,我的〜/ .android文件夹的权限错误



具体来说,Android Studio需要能够写入该文件夹。默认情况下,我的安装创建该目录为root拥有,只能由root写入。这是一个问题,因为Android Studio正像我一样运行,因此没有权限写入。



您可以通过在Terminal.app中执行这些命令来确认或您运行的任何终端应用程序):



您可能会看到这样的权限:

 > cd〜
> ls -la
... cut ...
drwxr-xr-x 7 root andyo 238 3月31日14:00 .android
... cut ...

问题是,由于root拥有目录,权限设置为755,则非root用户无法写入到目录。



要修复这个,只需将目录的所有权更改为自己(不应该有任何root拥有的目录在您的主目录中)。

 > sudo chown -R andyo .android 
> ls -la
... cut ...
drwxr-xr-x 7 andyo andyo 238 3月31日14:00 .android
... cut ...


I'm a newbie to programming in Android, and I just tried to run my build and got this message

Execution failed for task ':app:validateDebugSigning'.
> Unable to recreate missing debug keystore.

What does this mean? I'm using Android Studio.

解决方案

I just resolved this same problem, the permissions on my ~/.android folder were wrong.

Specifically, Android Studio needs to be able to write to that folder. By default, my installation created that directory as owned by root, and only writable by root. This was a problem because Android Studio was running as me, and thus did not have permissions to write there.

You can confirm this by executing these commands in Terminal.app (or whatever terminal app you run):

You'll probably see permissions like this:

> cd ~
> ls -la
...cut...
drwxr-xr-x    7 root  andyo      238 Mar 31 14:00 .android
...cut...

The problem is that, since root owns the directory and the permissions are set as 755, then the non-root user cannot write to the directory.

To fix this, just change the ownership of the directory to be yourself (there shouldn't be any root owned directories in your home directory anyway).

> sudo chown -R andyo .android
> ls -la
...cut...
drwxr-xr-x    7 andyo  andyo      238 Mar 31 14:00 .android
...cut...

这篇关于无法重新创建缺少的调试密钥存储区?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆