I am trying to use the xr package in Overleaf and set a custom font in the referenced file. However, as soon as I load the fontspec package in the referenced file, the xr package does not recognize the references anymore.
Of File2.tex, recompiling File2.tex twice and File1.tex twice using XeLaTeX as compiler then results in ?? instead of the reference number and a warning saying
Reference `label1' on page 1 undefined
Is there some interference between the xr package and fontspec? Or am I overlooking something?