The error occurs due to a space present in the path of the project Folder:
Usually Windows is able to resolve the spacing issue using the "8dot3" File Name Creation feature. However sometimes this feature may get disabled by some programs. Turning this feature on will hopefully resolve the issue.
Steps to turn the feature on:
1. Open Command Prompt (Admin mode).
Alternatively, you can try remove the space between "MATLAB Add-Ons" and thus modify the project folder path and try building the model again.
If the above steps did not work, then it is possible that the short name for the working directory was never created, even though the "8 dot 3" feature is enabled. Reason could be that this feature was enabled after the long name folder path was created. To confirm this, try the following:
1. Open Windows Command Prompt in admin mode
2. Traverse to MathWorks folder:
>> cd C:/Users/xxxx/AppData/Roaming/MathWorks
3. Then run the following :
4. This will list all the folder within the directory along with the short names (If they exist). If the short name exists for "MATLAB Add-Ons", it will have the short name listed with something like this "MATLAB~1".
5. Most likely there won't be any short name. In this case please execute the following command to create one:
fsutil file setshortname "C:/Users/xxxx/AppData/Roaming/MathWorks/MATLAB Add-Ons" MATLAB~8
Now re-build the model. This should hopefully resolve the issue.