Hi Filomela,
I think you would benefit a lot from reading the documentation and the examples of the website since there are many basic mistakes in your code.
1. UpSet: Tag C in ... is Protected.
This means that you cannot use the name "C" for a tensor, change it for instance to CC
2.
L = Sqrt[-Detg[]] (RicciScalarCD[] -
1/2*CD[-a][\[Phi][]] CD[a][\[Phi][]] -
1/4 Exp[- C \[Phi][]] IndexSet[F[a_, b_],
CD[a]@A[b] - CD[b]@A[a]];);
IndexSet is a standalone function that sets the value of F. You used it before in the right place and from that point on, you can simply write F[a,b], F[-a,-c]...
I guess you want
L = Sqrt[-Detg[]] (RicciScalarCD[] -
1/2*CD[-a][\[Phi][]] CD[a][\[Phi][]] -
1/4 Exp[- CC[] \[Phi][]] F[a, -a])
Notice the brackets after CC that you missed before.
3. VarD[F[LI[1], -a, -b], CD] will always return zero since F[-a,-b] is automatically substitute by CD[-a][A[-b]]-CD[-b][A[-a]]. If you want to work with both A and F you should use MakeRule instead of IndexSet
4. VarD[\[Delta]\[Phi][LI[1]], CD] shold be changed by VarD[\[Delta]\[CurlyPhi][LI[1]], CD]. Notice that \[Delta]\[Phi] appears in blue because it has not been defined
5.
ds2 = \[Lambda] (r) dt^2 - \[Lambda] (r)^(-1) dr^2 - R^2 d\[Theta]^2 -
R^2 Sin[\[Theta]]^2 d\[Phi]^2;
\[Lambda] (r) = (1 - rPlus/r) (1 - rMinus/r)^((1 - C^2)/(1 + C^2));
doesn't make too much sense. You should remove it or comment it with (* *)
6. R == RAsymptotic doesn't contain M or Q, so solving this for M and Q doesn't make sense.
I hope this helps!