One thing to do would be to check the permissions for the directory to make sure it is not restricted to have files written to it.
I had to create a copy of the folder. After that everything worked fine.
I thnk this may be a bug because I've published from this directory frequently in the past. There weren't any restrictions on the directory.
Still getting this problem now and the solution is the same as above -
change target folder for publishing .ipa everything is fine.
Weird and dumb!