New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make it possible for Traute to work in Android projects with existing annotation processors #89

Closed
denis-zhdanov opened this Issue Jan 2, 2018 · 1 comment

Comments

Projects
None yet
1 participant
@denis-zhdanov
Owner

denis-zhdanov commented Jan 2, 2018

There is a possible case that a Android Gradle project is configured to use particular annotation processor(s). The build fails after adding Traute with an error like below:

Caused by: org.gradle.api.InvalidUserDataException: Cannot change dependencies of configuration ':myproject:annotationProcessor' after it has been included in dependency resolution.
        at org.gradle.api.internal.artifacts.configurations.DefaultConfiguration.validateMutation(DefaultConfiguration.java:643)
        at org.gradle.api.internal.artifacts.configurations.DefaultConfiguration$2.run(DefaultConfiguration.java:177)
        at org.gradle.api.internal.DefaultDomainObjectCollection.assertMutable(DefaultDomainObjectCollection.java:274)
        at org.gradle.api.internal.DefaultDomainObjectCollection.add(DefaultDomainObjectCollection.java:165)
        at org.gradle.api.internal.DelegatingDomainObjectSet.add(DelegatingDomainObjectSet.java:82)
        at org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler.doAdd(DefaultDependencyHandler.java:84)
        at org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler.add(DefaultDependencyHandler.java:61)
        at org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler.add(DefaultDependencyHandler.java:57)
        at org.gradle.api.artifacts.dsl.DependencyHandler$add.call(Unknown Source)
        at tech.harmonysoft.oss.traute.gradle.TrauteGradlePlugin.applyOptions(TrauteGradlePlugin.groovy:52)
        at org.gradle.internal.metaobject.BeanDynamicObject$GroovyObjectAdapter.invokeOpaqueMethod(BeanDynamicObject.java:453)
        at org.gradle.internal.metaobject.BeanDynamicObject$MetaClassAdapter.invokeMethod(BeanDynamicObject.java:405)
        at org.gradle.internal.metaobject.BeanDynamicObject.invokeMethod(BeanDynamicObject.java:170)
        at org.gradle.internal.metaobject.ConfigureDelegate.invokeMethod(ConfigureDelegate.java:80)
        at tech.harmonysoft.oss.traute.gradle.TrauteGradlePlugin$_apply_closure1$_closure8.doCall(TrauteGradlePlugin.groovy:35)
        at org.gradle.api.internal.ClosureBackedAction.execute(ClosureBackedAction.java:70)
        at org.gradle.util.ConfigureUtil.configureTarget(ConfigureUtil.java:160)
        at org.gradle.util.ConfigureUtil.configureSelf(ConfigureUtil.java:136)
        at org.gradle.api.internal.AbstractTask.configure(AbstractTask.java:520)
        at org.gradle.api.internal.AbstractTask.configure(AbstractTask.java:77)
        at org.gradle.util.ConfigureUtil.configure(ConfigureUtil.java:104)
        at org.gradle.util.ConfigureUtil$1.execute(ConfigureUtil.java:123)
        at org.gradle.internal.Actions$FilteredAction.execute(Actions.java:205)
        at org.gradle.api.internal.DefaultDomainObjectCollection.all(DefaultDomainObjectCollection.java:117)
        at org.gradle.api.internal.DefaultDomainObjectCollection.all(DefaultDomainObjectCollection.java:122)
        at org.gradle.api.internal.tasks.RealizableTaskCollection.all(RealizableTaskCollection.java:192)
        at org.gradle.api.internal.DefaultDomainObjectCollection.withType(DefaultDomainObjectCollection.java:133)
        at org.gradle.api.DomainObjectCollection$withType$1.call(Unknown Source)
        at tech.harmonysoft.oss.traute.gradle.TrauteGradlePlugin$_apply_closure1.doCall(TrauteGradlePlugin.groovy:34)
        at org.gradle.listener.ClosureBackedMethodInvocationDispatch.dispatch(ClosureBackedMethodInvocationDispatch.java:40)
        at org.gradle.listener.ClosureBackedMethodInvocationDispatch.dispatch(ClosureBackedMethodInvocationDispatch.java:25)
        at org.gradle.internal.event.AbstractBroadcastDispatch.dispatch(AbstractBroadcastDispatch.java:44)
        at org.gradle.internal.event.BroadcastDispatch.dispatch(BroadcastDispatch.java:79)
        at org.gradle.internal.event.BroadcastDispatch.dispatch(BroadcastDispatch.java:30)
        at org.gradle.internal.dispatch.ProxyDispatchAdapter$DispatchingInvocationHandler.invoke(ProxyDispatchAdapter.java:93)
        at com.sun.proxy.$Proxy12.afterEvaluate(Unknown Source)
        at org.gradle.configuration.project.LifecycleProjectEvaluator.notifyAfterEvaluate(LifecycleProjectEvaluator.java:67)
        ... 44 more

@denis-zhdanov denis-zhdanov self-assigned this Jan 2, 2018

denis-zhdanov added a commit that referenced this issue Jan 2, 2018

@denis-zhdanov

This comment has been minimized.

Owner

denis-zhdanov commented Jan 2, 2018

Done

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment