Can Newton's Law of gravity be deduced using dimensional analysis? 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?
 A: A major limitation of dimensional analysis is that you must know some of the physics behind the concept that you are attempting to analyze, and since you have chosen to make the proportionality constant dimensionless, it has skewed your results. 
However, we can easily deduce the dimensional properties of this constant by rearranging the equation you were attempting to analyze :
$F= \dfrac{K * m_1*m_2}{r^{2}}$
$K= \dfrac{r^2*F}{ m_1*m_2}=\dfrac{m*v*r^2}{ m_1*m_2*t}$  
In dimensional form:$\implies \dfrac{[M][L^1][T^{-1}L^{-2}]}{[T][M][M]}={[M^{-1}][L^3][T}^{-2}]$, which is exactly what we would expect for the dimensions of the gravitational proportionality constant. However, to get to this point, you still have to know that $F=m*a$. 
A: first we find the dimentions of gravitational constant by gravitational formula.  because G is dimentional constant.  Then by putting its value in formula of force of gravitation.  then formula is balanced perfectly. 
A: Also if you have noticed 'c' is coming out to be 1, while it should be -2 . This clearly indicates that constant also has some dimensions. Hence in this case you cannot use dimension analysis to find out the formula. Only way out is the way SIR newton did it. 
