Unable to recreate missing debug keystore?

2020-05-25 05:09发布

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.

3条回答
▲ chillily
2楼-- · 2020-05-25 05:27

Running the IDE as Administrator did a trick for me. It was a permissions issue on my computer. Just left it here if somebody need.

查看更多
霸刀☆藐视天下
3楼-- · 2020-05-25 05:35

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...
查看更多
够拽才男人
4楼-- · 2020-05-25 05:40

May be it's because the new "instant-run" feature. My write-permissons for the .android folder where ok. But for me it worked only after i deleted the hole ".android" folder then i had to CREATE A NEW EMULATOR, and only after that there was a new debug.keystore

查看更多
登录 后发表回答