Custom Package not compiling - Failing to resolve namespaces

For context: I am porting our current project to Nintendo Switch and we need to optimize some features within the URP. That’s why I want to clone the URP to be able to modify the source code.

My steps were:

  • Copy com.unity.render-pipelines.universal from Library\PackageCache to Packages\
  • Changing the manifest.json to reference file:com.unity.render-pipelines.universal.
  • I ensured the packages-lock.json has the correct URP package reference after auto-update.
  • I ensured that the custom version is showing up in the Asset explorer under Packages.
  • I also tested to change the source code and confirmed that the new changes appear inside the Asset explorer under Packages.
  • I also restarted unity a couple of times.

And yet still I receive these errors:

It just can’t resolve the namespaces. This usually states that the package or the files could not be resolved, but I just don’t understand why the package itself cannot find Symbols from it’s own source.

Is it because it can’t resolve it’s own dependencies? Because it’s locally embedded?

Any help appreciated. Thank you in advance.
Best,
Katarina

It’s worth mentioning, that I did not do any changes to the package yet. This is what it looks like from the IDE.

Within the package itself, it can only resolve round about half of the symbols. Where most symbols are ont even from a dependency, but from within the same namespace.

Not sure why you edited the manifest.json to reference the package. I believe embedded packages simply need to be copied into the /Packages directory without any edits to the manifest. So perhaps try removing that line from the manifest. It may automatically get added back in though, but perhaps using different syntax than what you entered manually.

Also, I suppose editing the manifest is equal to uninstalling the URP version from Package Manager. But maybe it isn’t and thus you have both in your project.

Lastly, the issue may be related to the unit tests. Perhaps they simply don’t work as an embedded packages? It should be safe to delete the Tests folder from the package. Though your second screenshot seems to indicate that not all errors are related to unit tests.

1 Like

Ah, it is good to be informed. I obtained that information from this documentation.

I began anew and placed the URP package directly into the Packages folder instead of altering the manifest. Subsequently, Unity updated the manifest automatically, as you astutely predicted, and no namespace issues arose. I surmise that during the “Installing packages” process, the appropriate compilation was handled, which my IDE seemingly failed to execute.

Thank you for enlightening me with this piece of information. It helped out greatly.

1 Like