I had spent a while building up one large package with a bunch of tools that I used reasonably often, but now I want to separate them so that I only need to import the ones that I’m actually using. I’ve found that some of my packages have dependencies on each other, such as needing the singletons for my Bootstrapper system.
I pulled out the singleton first and set it on it’s own of the repository, and when I try to import that branch onto my Bootstrapper branch so that it doesn’t have errors in the console, I get the errors below and none of the package files are imported, but the folder is. How can I fix this?
GUID [8eff809e4fa241641917604f276b8d99] for asset ‘Packages/[Package Name]/package.json’ conflicts with:
‘Assets/[Package Name]/package.json’ (current owner)
We can’t assign a new GUID because the asset is in an immutable folder. The asset will be ignored.
I get that error message for multiple files:
package.json
Runtime
Singleton assembly definition conflicts with Bootstrapper Assembly Definition (these ones aren’t even the same file name)
Each error comes in 3 times, so I get 9 errors in total. 6 of them are that the package files conflict with the local files, while the other 3 have the local files conflicting with the package files.
I cannot properly separate my packages if I can’t import them together into a single project because some of them do rely on the others.
I was able to remove one set of conflictions, so now I just have 3 for each. 3 about local files conflicting with package files and 3 for package files conflicting with local files.
I had accidentally left an empty project import in the packages folder from a previous failed attempt. Removing the failed import removed 3 of the 9, but my other 6 are not caused by the same thing. I have 3 conflictions which each being reported twice.
Found a solution but I’m not happy with what it was. I had to copy paste my folders, that way the new files would each have a new GUID.
Not thrilled but it worked in the end.
You copied the package contents, duplicating the .meta files. Now Unity realizes you have the same files with the same GUIDs.
You can avoid this by creating a new, empty package. Then in Unity, drag and drop the script file to the other package. Or just manually move the .cs files to the new package via Explorer but ignore the .meta files - Unity will at most notify you that there’s a .meta file with no associated asset and will just delete it. (*)
(*) Note that if you allow Unity to generate a new .meta file for a script, you will lose any references to that script. Ie a GameObject with your singleton component will then show “Missing Script”. Just to keep this in mind.
Or copy the package contents but before adding the new package to Unity, delete all the .meta files in that copy.
Personally, I would create a new empty package, then use the IDE to move scripts around, as well as the refactoring tools in case you need to adjust namespaces or pull types out into other types and so on.