Error:Cannot change dependencies of configuration ':app:_debugAnnotationProcessor' after it has been resolved

I got it when trying to add a dependency to "com.android.support.constraint:constraint-layout:1.0.0-beta4" for an android training class.

I managed to get past it and it did involve Jack, as @Scott suspected.

Got past it by:

  1. commenting out the added dependency, the jackOptions enable true block, and the compileOptions block, where I had it compatible with 1.8.
  2. Sync/Clean/Rebuild Gradle (whichever it is, I'm still learning)
  3. Uncomment the added dependency, sync/rebuild gradle again
  4. Uncomment the jackOptions and compileOptions blocks, sync/rebuild gradle again

At that point, it worked for me.


Add it to app build.gradle or project build.module:

repositories {
    maven {
        url 'https://maven.google.com'
    }
}

I get this problem when I add 'constraint-layout' dependency and I find out answer in ofical manual: https://developer.android.com/training/constraint-layout/index.html I think it will help you!


After hours of trying everything, this worked for me -> Upgrade com.google.gms:google-services to latest version. Case : added

dataBinding {
   enabled = true
}

Solution : In project gradle classpath changed

'com.google.gms:google-services:3.3.1'

to

'com.google.gms:google-services:4.0.1' (latest version)