I started using Perforce recently. Using it with Unity was not straightforward as one expect it to be.
The first problem I got into is the same as reported here:
So I moved to built-in Unity Perforce support.
It worked fine for the most part, but I got many errors of UnauthorizedAccessException because Unity was trying to edit settings files that were not checked out.
I know this is intended behavior, however when the editor itself tries to access those files the checkout should be automatic.
The solution was to checkout all project settings.
And then we come to the title of this thread: even after checking out all settings, I keep getting access errors to XRSettings.asset file (in ProjectSettings folder). I can’t find a way to checkout this file from inside Unity.
I can do it manually from P4V but this breaks the purpose of using built-in Perforce support.
I managed to work around the problem this way: I checked out the file manually and moved to a different “changelist” in Perforce. So it is always checked out and I don’t have to worry about it anymore.
Although it is not a “Blocking” problem, it would be nice to the Unity check it out automatically.
I agree with @Oni07R this should be fixed to avoid any manual intervention.
After you check out the settings files in p4, are they actually writable? Maybe look at the file permissions before and after you check the files out?
P4 modifies the write permissions as you check files in and out. There are several different versions of this depending on the type of file and the p4typemap. Exclusive checkout +l or always writable +w are the most common. It’s possible the typemap is not configured correctly and it’s treating the files in a funny way?
Or maybe it has to do with the file type? I believe the settings files should be treated as binary, but maybe it’s treating them as text? If you look in p4 at any file in the depot it shows the type next to it. Something like this: myfile.asset(23/23)
I have almost the exact opposite problem, unity always auto checks-out some of the settings files, even when i haven’t made changes to them. I always have to look in my change list in p4 to see what got checked out. The settings files are always exactly the same as the previous revision so i just revert.