Where are the file templates in Android Studio 4.1 located?

4.4k Views Asked by At

I have trouble importing my custom file templates into Android Studio 4.1 Canary 5. In prior versions of Android Studio (up to 4.0) I used to copy my templates into

<Android Studio Installation>/Contents/plugins/android/lib/templates (I am using Mac)

But in 4.1, there are no templates there and when I copy mine there, they seem to be ignored.

Has anyone faced the same issue?

Thank you!

4

There are 4 best solutions below

0
On

File > Settings> File and Code templates> press + icon to add new template

1
On

For android studio 4.1 I found the live templates XML in this below path:

IDE configuration directory changes The locations of user configuration directories have been changed to the following:

Windows Syntax: %APPDATA%\Google<product>

Example: C:\Users\YourUserName\AppData\Roaming\Google\AndroidStudio4.1

macOS Syntax: ~/Library/Application Support/Google/

Example: ~/Library/Application Support/Google/AndroidStudio4.1

Linux Syntax: ~/.config/Google/

Example: ~/.config/Google/AndroidStudio4.1

C:\Users\YourUserName\AppData\Roaming\Google\AndroidStudio4.1\templates

0
On

For android studio 4.1 I found the live templates XML in this below path:

~/Library/Application Support/Google/AndroidStudio4.1/settingsRepository/repository/templates

This is for Mac OS

0
On

Android Studio 4.1 uses a new templating API which is visible but not public yet - you can see a sample here, although I haven't been able to get this to work. Unfortunately in the process, Google seem to have removed the old way of adding templates.

For those interested in tracking progress, you can star the issue on Google's issue tracker system here.