Make sure your Andorid phone is up to date and that you've not blocked the access.
Switch car on and infotainment on first. Make sure it's booted. Then unlock your phone before connecting the cable.
There's a known bug in a version of Android that cuts off AndroidAuto when the battery is fully charged. This is resolved in recent updates, but not all phones get the latest version of Android.
Everyone thats had issues has boiled down to cable or a fairly old (in technology terms) Android based phone. Only issue I've had with my Samsung S20 is prematurely connecting the cable, just popping it out and back in again resolved. I have a 30cm ugreen cable from Amazon.