The question is difficult to answer and has many levels.
Let’s first try to understand this from economic-level. India is China’s one of top trading partners. We rank 11th in terms of largeness in consuming China’s export. From the other side, India gets its largest import from China. So both the economies are highly dependent on each other. Meaning, even when they don’t want to, they must continue on friendly terms for the sake of their economic development and sustainability. Because, China and India will become the biggest economies in the world by 2050, even overtaking USA, and neither can do that without the support from other.
Now let’s talk from the military point of view. China has the largest army in the world, followed by India (USA is #3). Both of these countries hushedly want to be a super-power in Asia, and hence the world. And this is one big reason behind the tussle between them. So on diplomatic levels, both China and India has always been in conflict to prove one’s power over the other. China is close to Pakistan, while India has Japan on its side. The idea of military warfare between these two countries is distant, even with recent Doklam Standoff. But they both, in their quest to be super power, will continue to battle it out in diplomacy. Meaning, the wish of friendship between India and China will hardly come soon.
And then we must consider the parties in power, forming the government, in both the countries. For example, Modi Government – much to the delight of jingoist crowd – has been more aggressive on China than its predecessor. China has been countering this on many levels. One, by stopping New Delhi’s attempt to get Jaish-e-Mohammad chief Masood Azhar declared as UN-designated terrorist. When the powers in both the country will change, may be then they will be on friendly terms. As of now, they are friendly—but only on the front.

Also Read- why is China is growing fast?