Finally got my car to start after months and while I let the car run it sounds smooth after a couple of minutes the car shuts off. I go to start it again but this time its only cranking and not turning over a couple of days go by after diagnosing and I go to charge the battery and for at least an hour the car is still cranking finally after a hundred attempts it turns over sounding fine same thing happens after a minute it shuts off and I'm back to square one where it just cranks. Any help would be appreciated thanks in advance!
Spark, coils, and high-pressure fuel pump were recently replaced.


2013 BMW 328 xDrive awd n20