  In this article we introduce $A$-valued Einstein-Hilbert-Palatini functional
($A$-EHP) over a n-manifold $M$, where $A$ is an arbitrary graded algebra, as a
generalization of the functional arising in the study of the first order
formulation of gravity. We show that if $A$ is weak $(k,s)$-solvable, then
$A$-EHP is non-null only if $n<k+s+3$. We prove that essentially all algebras
modeling classical geometries (except semi-Riemannian geometries with specific
signatures) satisfy this condition for $k=1$ and $s=2$, including Hitchin's
generalized complex geometry, Pantilie's generalized quaternionic geometries
and all other generalized Cayley-Dickson geometries. We also prove that if $A$
is concrete in some sense, then a torsionless version of $A$-EHP is non-null
only if $M$ is K\"{a}hler of dimension $n=2,4$. We present our results as
obstructions to $M$ being an Einstein manifold relative to geometries other
than semi-Riemannian.
