3

After upgrading gradle from 4.1.3 to 4.2.1 I started getting this error while building the app

The value for property 'resValues' cannot be changed any further.

humazed
  • 74,687
  • 32
  • 99
  • 138

3 Answers3

7

just update to 1.9.2

[1.9.2] 2021-06-07 Fixed an issue where the Gradle plugin would fail with AGP 4.2 due to an IllegalStateException ("The value for property 'resValues' cannot be changed any further.")

It turns out to be a problem with heapanalytics after removing apply plugin: 'com.heapanalytics.android' fixes the problem.

so you could remove heapanalytics or delay the gradle update and continue using 4.1.3 until the heap team fixes this issue.

from here:

Nora from Heap support here! Our mobile team has prioritized this issue and is actively working on a release version with support for Android Studio 4.2. The current release timeline for the supported version is by the end of this June.

humazed
  • 74,687
  • 32
  • 99
  • 138
2

I was getting this error when trying to set a resValue inside a project.afterEvaluate { block. After upgrading to 4.2 I was just able to remove the afterEvaluate and it now works.

aaronmarino
  • 3,723
  • 1
  • 23
  • 36
  • It worked for me. removing project.afterEvaluate bloack and remaining inside code resolved my problem. – mazend Mar 05 '22 at 16:35
1

In heapanalytics 1.9.2 the issue is fixed

Róbert Nagy
  • 6,720
  • 26
  • 45