问题
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.
回答1:
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...
回答2:
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
回答3:
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.
来源:https://stackoverflow.com/questions/21415156/unable-to-recreate-missing-debug-keystore