Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Unable to recreate missing debug keystore?

Tags:

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.

like image 667
Brandroid Avatar asked Jan 28 '14 19:01

Brandroid


People also ask

How do I get the debug keystore?

After clicking on the app, Navigate to Tasks. Inside Tasks, navigate to “android” and double click on the signing report option. After clicking on this option you will get to see the path for your debug. keystore file.

How do I change my default debug keystore?

EDIT Step 1) Go to File > Project Structure > select project > go to "signing" and select your default or any keystore you want and fill all the details.


1 Answers

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... 
like image 58
Andy Obusek Avatar answered Oct 12 '22 19:10

Andy Obusek