[Xiaomi 11T Pro] diogotc:
If you've installed a custom ROM that doesn't come with Android Auto pre-installed, you'll get the following error when connecting your phone to your car (the Android Auto app opens correctly, the error is only shown when you connect to the car):

View attachment 5636057

This error happens because Android Auto is not installed as a system app under /system/priv-app.

The following steps will ensure you can convert Android Auto from a user app to a system app. As usual, I'm not responsible for any damage to your device due to this guide.

Requirements:

Magisk and Magisk Manager (I've tested with 24.3)

Android Auto installed as a user app (I have 7.6.621734-release)

A computer with ADB or an app like Termux

I've tested this on a Xiaomi 11T Pro with Pixel Experience Plus Slim 12.1 (GSI) and Android 12, but it should work for other devices and ROMs as well.

Steps:

Install BusyBox from the Play Store

I could only install to /system/bin, but try out what works for you ROM

Click "Install" and wait for a successful message

(optional) This is just a BusyBox installer, I think you can remove the app at the end of this tutorial

Download terminal_systemizer Magisk module. Keep in mind the latest official release is outdated and does not work on Android 12 and Magisk 24.3. Because of this, you can download it from this post on XDA or clone this fork on GitHub and zip it

Install the Magisk module through Magisk Manager and reboot

Now connect your phone to your computer and launch an adb shell with adb shell, or open Termux

Enter root mode by typing su (not sure if this is required on Termux, but you must do it on adb shell)

Verify that the systemizer module is working by running the help command

# systemize -h

App Systemizer (Terminal Emulator) v17.5(73)
by veez21, KreAch3R, entr0pia

Usage: systemize
or: systemize [options]...

Options:
-nc removes ANSI escape codes
-f use 'Set SELinux' in the session for faster app listing
-a [package name] systemizes the package name(s) provided
-d [apk dir] systemizes the apk(s) provided
-l list all systemized apps
-h show this message

If you get a similar output, you're ready to proceed

Now run the systemize command without any arguments and answer the prompts accordingly. The app you want to systemize is com.google.android.projection.gearhead, which is Android Auto. You want to install it to /system/priv-app and NOT to /system/app.

Below is a sample output:

============================================
App Systemizer (Terminal Emulator) v17.5(73)
by veez21, KreAch3R, entr0pia
============================================
BusyBox v1.32.0-Stericson
/system/bin/busybox
============================================
Enter logs to upload logs
============================================
Set SELinux Enabled: false
SELinux Status: Enforcing
============================================

1 - Systemize Installed Apps (Listed)
2 - Systemize Installed Apps (Enter label)
3 - Systemize given APK
s - Set SELinux
0 - Exit

[CHOICE]: 1

Loading Apps [/]
============================================
Installed Apps =============================
============================================

...
18 - com.google.android.projection.gearhead
...

To systemize multiple apps, enter multiple number. Example: "1 23 30"
x - Back to Menu
r - Refresh list
0 - Exit
[CHOICE]: 18
============================================
Systemizing com.google.android.projection.gearhead
Checking APK directory - OK
Checking package name - com.google.android.projection.gearhead
Where to install?
< 1 - /system/app | 2 - /system/priv-app | 0 - cancel > : 2
Checking APK size - 41M
Transfering base.apk(com.google.android.projection.gearhead) to '/system/priv-app'...
Transfering libs
Granting Permissions
/system/bin/systemize[584]: aapt: can't execute: Permission denied
com.google.android.projection.gearhead - Done
Reboot to apply changes
Return to menu? < y | n >: n

Notice that it threw an error at the end, but it still worked for me. Not sure what happened, let me know if this also happened to you.

Reboot

Check that Android Auto is a system app by opening its app info page. If there is no uninstall button like below, it's installed as a system app

View attachment 5636069

Please reply if you have any questions or issues!

Hope this helps