java.lang.IllegalStateException: Resolving configuration 'apiElementsCopy' directly is not allowed

Hot problem!
This exception has a lot of traffic. You can help 20 users by writing a short tip.

Solutions on the web8

Solution icon of github
Resolving configuration 'apiElementsCopy' directly is not allowed

Solution icon of stackoverflow
Resolving configuration 'debugCompile' directly is not allowed

Solution icon of github
Resolving configuration 'apiElements' directly is not allowed

Solution icon of github
Resolving configuration 'debugCompile' directly is not allowed

Solution icon of github
via GitHub by xelibrion
, 6 months ago
Resolving configuration 'apiElements' directly is not allowed

Solution icon of github
via GitHub by zotona
, 6 months ago
Resolving configuration 'apiElements' directly is not allowed

Solution icon of github
via GitHub by aley2003
, 6 months ago
Resolving configuration 'apiElements' directly is not allowed

Solution icon of github
Resolving configuration 'apiElements' directly is not allowed

Stack trace

java.lang.IllegalStateException: Resolving configuration 'apiElementsCopy' directly is not allowed
	at org.gradle.api.internal.artifacts.configurations.DefaultConfiguration.assertResolvingAllowed(DefaultConfiguration.java:818)
	at org.gradle.api.internal.artifacts.configurations.DefaultConfiguration.resolveToStateOrLater(DefaultConfiguration.java:419)
	at org.gradle.api.internal.artifacts.configurations.DefaultConfiguration.getResolvedConfiguration(DefaultConfiguration.java:414)
	at org.gradle.api.internal.artifacts.configurations.DefaultConfiguration_Decorated.getResolvedConfiguration(Unknown Source)
	at sun.reflect.GeneratedMethodAccessor39.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:93)
	at groovy.lang.MetaBeanProperty.getProperty(MetaBeanProperty.java:62)
	at org.gradle.internal.metaobject.BeanDynamicObject$MetaClassAdapter.getProperty(BeanDynamicObject.java:213)
	at org.gradle.internal.metaobject.BeanDynamicObject.getProperty(BeanDynamicObject.java:156)
	at org.gradle.internal.metaobject.CompositeDynamicObject.getProperty(CompositeDynamicObject.java:55)
	at org.gradle.internal.metaobject.AbstractDynamicObject.getProperty(AbstractDynamicObject.java:60)
	at org.gradle.api.internal.artifacts.configurations.DefaultConfiguration_Decorated.getProperty(Unknown Source)
	at org.codehaus.groovy.runtime.callsite.PogoGetPropertySite.getProperty(PogoGetPropertySite.java:50)
	at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callGetProperty(AbstractCallSite.java:296)
	at com.github.benmanes.gradle.versions.updates.Resolver.resolve(Resolver.groovy:64)
	at com.github.benmanes.gradle.versions.updates.Resolver$resolve.call(Unknown Source)
	at com.github.benmanes.gradle.versions.updates.DependencyUpdates$_run_closure2$_closure8.doCall(DependencyUpdates.groovy:60)[...]

Write tip

You have a different solution? A short tip here would help you and many other users who saw this issue last week.

Users with the same issue

You are the first who have seen this exception. Write a tip to help other users and build your expert profile.