LoadError: ArgumentError: Package X does not have Y in its dependencies

I have been using Julia for years and dread this error because I have never been able to reliably fix it.

I am developing packages A and B, where A uses B as a dependency.
In Julia, in the main environment, using A errors with

ERROR: LoadError: ArgumentError: Package A does not have B in its dependencies:
- You may have a partially installed environment. Try `Pkg.instantiate()`
  to ensure all packages in the environment are installed.
- Or, if you have A checked out for development and have
  added B as a dependency but haven't updated your primary
  environment's manifest file, try `Pkg.resolve()`.
- Otherwise you may need to report an issue with A

…as is very familiar from so many other questions like this.

The problem is that B is in A’s dependencies Project.toml file, and after trying every combination of Pkg.resolve(), Pkg.instantiate(), restarting Julia, and using A (doing any/all of these in both A’s environment and the main environment), I still get this error.

What am I missing?

For starters please post the Project.tomls of both A and B and show a full REPL session where you activate the environment, do a ]status and then trigger the warning shown in the post.

To my great frustration, it’s working now. I’m not sure what I did now that I didn’t try before. Till next time!