alibaba/freeline

升级 AGP 到 3.0 之后,用 AS 打包成功。但 Freeline 就出错了!

xiyouMc opened this issue · 5 comments

Cannot change role of configuration ':<sub_project>:api' after it has been included in dependency resolution

 org.gradle.api.InvalidUserDataException: Cannot change role of configuration ':<sub_project>:api' after it has been included in dependency resolution.
        at org.gradle.api.internal.artifacts.configurations.DefaultConfiguration.preventIllegalMutation(DefaultConfiguration.java:795)
        at org.gradle.api.internal.artifacts.configurations.DefaultConfiguration.validateMutation(DefaultConfiguration.java:757)
        at org.gradle.api.internal.artifacts.configurations.DefaultConfiguration.setCanBeResolved(DefaultConfiguration.java:965)
        at org.gradle.api.internal.artifacts.configurations.DefaultConfiguration_Decorated.setCanBeResolved(Unknown Source)
        at org.gradle.api.artifacts.Configuration$setCanBeResolved$2.call(Unknown Source)
        at com.antfortune.freeline.FreelinePlugin$_findAptConfig_closure12.doCall(FreelinePlugin.groovy:702)
        at com.antfortune.freeline.FreelinePlugin.findAptConfig(FreelinePlugin.groovy:701)
        at com.antfortune.freeline.FreelinePlugin$_apply_closure4$_closure15$_closure22.doCall(FreelinePlugin.groovy:212)
        at com.antfortune.freeline.FreelinePlugin$_apply_closure4$_closure15.doCall(FreelinePlugin.groovy:192)
        at com.antfortune.freeline.FreelinePlugin$_apply_closure4.doCall(FreelinePlugin.groovy:51)
        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:42)
        at org.gradle.internal.event.BroadcastDispatch$SingletonDispatch.dispatch(BroadcastDispatch.java:230)
        at org.gradle.internal.event.BroadcastDispatch$SingletonDispatch.dispatch(BroadcastDispatch.java:149)
        at org.gradle.internal.event.AbstractBroadcastDispatch.dispatch(AbstractBroadcastDispatch.java:58)
        at org.gradle.internal.event.BroadcastDispatch$CompositeDispatch.dispatch(BroadcastDispatch.java:324)
        at org.gradle.internal.event.BroadcastDispatch$CompositeDispatch.dispatch(BroadcastDispatch.java:234)
        at org.gradle.internal.event.ListenerBroadcast.dispatch(ListenerBroadcast.java:140)
        at org.gradle.internal.event.ListenerBroadcast.dispatch(ListenerBroadcast.java:37)
        at org.gradle.internal.dispatch.ProxyDispatchAdapter$DispatchingInvocationHandler.invoke(ProxyDispatchAdapter.java:93)
        at com.sun.proxy.$Proxy24.afterEvaluate(Unknown Source)
        at org.gradle.configuration.project.LifecycleProjectEvaluator.notifyAfterEvaluate(LifecycleProjectEvaluator.java:76)

我也遇到类似问题了 Cannot change role of configuration ':<sub_project>:annotationProcessor' after it has been resolved ,不懂什么情况。

@Lilyandlucy 你这个问题 貌似是依赖的问题。 用 AS 能跑过吗

@xiyouMc 用 AS可以正常run build的,但是用Freeline就报上面那个错误

@Lilyandlucy 那就是同一个问题。 官方迟迟不给结果