Youssof
Youssof

Reputation: 1001

Unity Build Error `DirectoryNotFoundException`

Guys why I can't build my project why this error? Is wondershare related to Unity? Why I am having this error when I want to build my application on my android device? Any help would appreciated Error.

Upvotes: 8

Views: 8279

Answers (2)

Thommi1609
Thommi1609

Reputation: 1

For some reason, I thought it a good idea to change your %TEMP% environment variable, which is used when building in Unity.

To change it, search for "System": -"advanced system settings" -Environment Variables -System variables -TMPDIR: change from wondershare to existing dir. default is: "%USERPROFILE%\Appdata\Local\Temp"

To verify the path is correct you can open run with "Win+R" and type "%TEMP%". This should open the new TMPDIR.

You might have to restart your PC after this.

Upvotes: -2

Bizhan
Bizhan

Reputation: 17085

According to the error message, it looks like Unity's build pipeline is trying to create a temporary file with a random name inside a folder which does not exist.

It is most probable that some information is being cached in build.gradle or other parts of the project.

  • Close Unity

  • Delete Library and Temp folders

  • Open Unity


Afterwards, If you ran into an access denied error, restart your PC.

Upvotes: 5

Related Questions