Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to fix "Unmappable character for encoding windows-1252 error" displayed by Gradle build?

When building my project in Android Studio by executing the Gradle release task, I get the following error:

error: unmappable character for encoding windows-1252
 * usage: app:behavior_saveFlags=ÔÇ?hideable|skipCollapsedÔÇ?
                                                            ^

It doesn't break the build or doesn't seem to cause any bugs so far from what I know of, however I would like to find out what's causing this issue.

The error seems to be triggered by some of the generated comment blocks in R.java:

/**
 * Behavior properties will be saved and restored by evaluating each flag.
 * usage: app:behavior_saveFlags=”hideable|skipCollapsed”
 * <p>Must be one or more (separated by '|') of the following constant values.</p>

My configuration:

  • Android Studio 3.4
  • Gradle Tools 3.4.0
  • Gradle 5.4.1
like image 355
Martin Avatar asked Sep 02 '25 10:09

Martin


1 Answers

You probably have a config for encoding in the android compileOptions in your build.gradle

Look for encoding = 'Cp1252' and remove it.

android
{
    compileOptions {
        encoding = 'Cp1252'
    }
}
like image 67
Houf Avatar answered Sep 05 '25 00:09

Houf