Restore and Library Cache
After the resolution, the Libraries.lock.json lockfile will contain the full dependency graph with exact versions. Before the libraries are loaded by the compiler, they must exist in the file system of the project. The library cache is responsible for this. If a library is missing from the cache, then it will be restored from its sources. The project can be fully compiled only then.
Library cache
The library cache is located in the root directory of the project and is named .library-cache. The root directory is the folder <project name>.fbsdev or <project name>.fbslib. The libraries are stored in the cache as compiled libraries. The path in the cache follows a fixed convention.
.library-cache/Company/Title/Version/Title.compiled-library
Leading and trailing spaces of the components are removed. Characters not allowed in filenames are replaced via object model encoding. The on-disk format is the same as in a library repository. A library which points to a source library project via a relative path is not located in the cache. Instead, it will be loaded into the workspace as an editable project.
Restoring missing libraries
When restoring, the missing libraries are stored in the library cache. A library is considered missing when it is listed in the Libraries.lock.json file, but it does not exist in the cache at the specified path. Existing libraries will remain unchanged. The libraries originate from the configured library sources. This includes the library repositories and a deployment server.
You can use the Restore Missing Libraries command to initiate the restore process yourself. You will need to perform a manual restore mainly if the lockfile is already complete, but the libraries in the cache are missing. This problem often occurs after checking out from a version control system: the project contains the Libraries.lock.json file, but the .library-cache folder is usually not checked in as well. A restore will fetch the exact library state which is defined in the lockfile. You will not need to run the resolution again.
Tip
When you manually initiate a library resolution, the libraries will be restored automatically. A separate restore is not required in this case.