.meta file on different platform

we have several developers, some use unity on windows, some on Mac, and we use svn, when svn update on Mac, and then pack by using assetbundle,many .meta file has been changed, how to solve

That sounds like a “meta out of sync” problem. For the future, you’re best advised to create a svn hook that disallows any commits if

a) a new file is being added (file.ext)
b) that file.ext is located under /Assets
c) there is no corresponding file.meta added with the same commit

The hook should print a warning:

Commit failed due to missing .meta file. Open Unity project, then try committing again.

The issue is mostly found with art assets, where the artist saves or exports a texture or mesh directly under /Assets and commits the new file WITHOUT the Unity project open or without tabbing into the Unity project. This means Unity did not generate a GUID or .meta file for that asset.

If someone adds just a single asset file without .meta what happens is that anyone who pulls that change will generate a unique GUID for that asset, which is saved to the .meta file. So once that happens on more than one machine, you will have .meta file changes bouncing back and forth in source control, always changing the asset’s GUID.

At the same time, users will likely complain about “missing references” occuring seemingly at random for no reason. They may track it to a certain commit, ask that user, but that user swears they didn’t change anything (they really didn’t).

To fix this after the fact, have everyone close their projects. Then pull the project onto one machine, open the project, make sure everything works fine ie there shouldn’t be any missing references and build works. Then check in these changes. Between pulling and committing from this single machine, nobody else should have the project open and everyone must pull the latest changes right thereafter for everyone’s .meta files to be back in sync.

Possible other cause: not everyone is using the exact same editor version down to the patch level. Eg never run a mix of 2022.2.20f1 and 2022.3.12f1 and 2022.3.47f1 etc

.meta files are just YAML text files and you can easily diff them. What kind of changes do you see?

Could be just some platform-specific settings being populated that weren’t there because the relevant platforms had never been activated before?

hi, thanks your reply, I find it’s mainly happened on Mac, when do svn update, it’s all right, but after build Assetbundles, many .meta and .cn files changed, looks like unity on Mac have different .meta and .cn file

No, these should be identical.

You can verify this if you create a new project, put it under svn, and make changes on both OS. There should not be any changes to .meta files.

Do check WHAT gets changed. If the GUID changes, you do have a serious problem (see above: meta out of sync). If something else changes, check if this is perhaps related to using different editor versions.

There’s also the possibility that the Mac version will add some Mac-specific settings to the .meta files but it should not continue to make such changes repeatedly to the same assets, nor should any potential platform-specific content get removed.

In any case: look inside! You need to understand WHAT changes, and then you can figure out WHY that change happens. Just observing that files change is not enough.