Chosen Solution

After replacing my battery on my iphone 7 when powering on to check if all is working correctly, keeps cycling through the boot with the apple logo, then turns itself off, then on again booting, then off again. What is causing this, and how can i fix it?

What was wrong with the old battery? Does it cycle on and off only while plugged in or also not plugged in?