Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to fix "couldn't follow symbolic link" in Android Studio?

I'm now running an Android App project on Windows and running into the condition

Error:Could not list contents of 'D:\source\App\src\main\res\drawable'. Couldn't follow symbolic link.

after did the clean build.

Android Studio states the drawable file is a broken symbolic link.

I just check other related post online but still cannot figure out what does that mean, why is that happened, and how to fix it. Can anyone help to give me a clue to fix it?

like image 804
Ally Tsai Avatar asked May 16 '17 04:05

Ally Tsai


People also ask

How do I enable symbolic links?

How To Enable using Symbolic Links. The user must be given the "Create Symbolic Links" privilege or be in a group that has been given that privilege. If User Account Control (UAC) is on, any user with the "Create Symbolic Links" privilege that is not in the Administrators group can simply create a symbolic link.

What does it mean to follow a symbolic link?

A symbolic link contains a text string that is automatically interpreted and followed by the operating system as a path to another file or directory. This other file or directory is called the "target". The symbolic link is a second file that exists independently of its target.

How do I restore a symbolic link?

There is no command to retarget a symbolic link, all you can do is remove it and create another one. The rename command's -s option will "rename a symbolic link target, not the symbolic links itself". It will also operate on multiple symbolic links at once.

Do symbolic links work both ways?

Yes, a symbolic link is a pointer to another location. This means that any changes you make are in fact updating at the target location.


2 Answers

Next time to save time you can run the following command:

find . -type l -exec test ! -e {} \; -delete
like image 186
Vishu Avatar answered Oct 20 '22 22:10

Vishu


Still do not know the real reason but problem solved by re-checkout source. Clean build did not work so I guess there's just something wrong in the project build-up steps.

like image 30
Ally Tsai Avatar answered Oct 20 '22 21:10

Ally Tsai