I am facing issues with the newest Android build tools. Something has changed and suddenly in generated classes (directory marked as "generated" in Android Studio) an additional comment on top of the file is being added, which contains the command used to generate the class. It started causing issues, because suddenly builds started failing because of "Illegal unicode escape"
, which is somewhat understandable, because my build variant name starts with "u"
, so the command used to generate the class contains something like \uvariantName
which of course is an illegal escape because of the \u
part.
For now I have decided to use buildToolsVersion '34.0.0'
in "infected" modules, which is a fine workaround.
So right now I am thinking if there is a way to disable the addition of the command in the comment to truly solve the problem? I mean, thinking seriously and all I can't be the only one affected by such change?
I tried looking into what generates those classes but I lack knowledge on how to actually find that information (even asked GPT about it). The project I encounter this problem in is pretty robust, so I didn't actually look through all configs, etc. I just need a nudge in the right direction, if someone is able to tell me where those classes might come from then I will look into how to configure that thing and check the changelog myself.
I am facing issues with the newest Android build tools. Something has changed and suddenly in generated classes (directory marked as "generated" in Android Studio) an additional comment on top of the file is being added, which contains the command used to generate the class. It started causing issues, because suddenly builds started failing because of "Illegal unicode escape"
, which is somewhat understandable, because my build variant name starts with "u"
, so the command used to generate the class contains something like \uvariantName
which of course is an illegal escape because of the \u
part.
For now I have decided to use buildToolsVersion '34.0.0'
in "infected" modules, which is a fine workaround.
So right now I am thinking if there is a way to disable the addition of the command in the comment to truly solve the problem? I mean, thinking seriously and all I can't be the only one affected by such change?
I tried looking into what generates those classes but I lack knowledge on how to actually find that information (even asked GPT about it). The project I encounter this problem in is pretty robust, so I didn't actually look through all configs, etc. I just need a nudge in the right direction, if someone is able to tell me where those classes might come from then I will look into how to configure that thing and check the changelog myself.
Share Improve this question asked Mar 7 at 13:34 XirateXirate 1093 bronze badges 1- You might consider editing your question and providing more details about a specific example. What is an example generated source file that exhibits this behavior? What is the generated source code, in particular the comment that is giving you problems? What is generating that source code? – CommonsWare Commented Mar 7 at 14:25
1 Answer
Reset to default 0gradle.properties
android.aaptOptions.additionalParameters += "--no-version-vectors"
android.aaptOptions.additionalParameters += "--no-version-comments"