Enable long path support in Windows 10/11:
When the error appears, follow this systematic approach:
Also check and Unit output directory . Shorten them manually. Directory Preparation Failed Delphi
The user’s Documents folder had inherited a Read-only flag from a previous Windows profile migration. Delphi could not create temporary project files.
Also inspect for stray characters.
Add these folders to your antivirus exclusion list:
In Delphi: → Set to Detailed or Diagnostic . Enable long path support in Windows 10/11: When
The error can also occur when preparing the for .dex or .so files. Solutions are the same: check permissions on C:\Users\<you>\AppData\Local\Temp\ and any project subfolder.