u/hap4ev

Help! Every time I change my app icon, some XML resources are automatically generated with syntax errors
▲ 6 r/AndroidStudio+1 crossposts

Help! Every time I change my app icon, some XML resources are automatically generated with syntax errors

Using the latest Android Studio on Linux (v. 2025.3.4 Patch 1), when I change the app's default icon (by adding an image asset, either SVG or PNG), at least these three XML files are automatically generated/updated:

* values/ic_launcher_background.xml
* mipmap-anydpi-v26/ic_launcher.xml
* mipmap-anydpi-v26/ic_launcher_round.xml

However, after changing the icon, the project no longer compiles, displaying a syntax error message in these XML files. I noticed that these XML files ended up being generated with copyright comments starting on the first line (a valid XML should start with a line like this:

<?xml version="1.0" encoding="utf-8"?>

, and the comments can come after).

Please see the following screenshot showing how one of these XML files is badly generated:

https://preview.redd.it/nw33xjzz501h1.png?width=1076&format=png&auto=webp&s=ed936338afb65be247748fdcd2673c5240547435

If I manually remove those xml comment lines, the project compiles fine and the icon are updated accordingly.

I don't know where this copyright message comes from, especially since it's placed in the wrong place.

I've already created a new project from scratch, cleaned the Android Studio configuration files directory, disabled a plugin called "copyright," and it didn't solve the problem.

Has anyone else experienced this? Thanks in advance.

reddit.com
u/hap4ev — 9 days ago