I tried using dimensional analysis to deduce Newton's law of gravity but I wasn't able to do so as one of the equations were $0=-2$ which is a contradiction. But I thought that we can't do that because the constant of gravitation has some dimensions which make such deduction not possible.
Is that the reason? If yes, Is there any possible way to deduce Newton's law using dimensional analysis (a very good trick for example)?
Also, When does dimensional analysis fail to give us a correct relation? what are its limitations?
Added: Here is my trial on deducing newton law:
First of all, $F$ is propotional to $M_1 , M_2 , r$.
So, $F=K M_1^a M_2^b r^c$ where $K$ is a constant and $a,b,c$ are numbers.
Now, $[F]=[M^1L^1T^{-2}]$ and $R.H.S = [M]^a[M]^b[L]^c = [M^{a+b}L^cT^0]$
So, we have: $[M^{a+b}L^cT^0]=[M^1L^1T^{-2}]$. equating both sides we get, $a+b=1, c=1 , 0=-2$, a contradiction. What is the problem?