如何修复错误无法更改Gradle中的配置策略? [英] How to fix the error Cannot change strategy of configuration in gradle?
问题描述
我收到尝试通过Gradle构建项目的错误消息:
I am receiving the error trying to build the project by Gradle:
gradle -q acRpm
gradle -q acRpm
FAILURE: Build failed with an exception.
* Where:
Script '/Users/anarinsky/eclipse-workspace/aaa/build/gradle-tools/build-scripts/repo-config.gradle' line: 32
* What went wrong:
A problem occurred evaluating script.
> Cannot change strategy of configuration ':fixMe' after it has been resolved.
据我了解,此问题特定于Gradle版本> = 3.0.是的,此脚本适用于gradle的2. *版本.有什么解决方法吗?我在MacOs Sierra上.
As I understand this problem is specific for gradle version >=3.0. Yes, this script works at the 2.* version of gradle. Is there any workaround? I am on MacOs Sierra.
推荐答案
我收到此错误的实际原因是 classpath'gradle.plugin.com.onesignal:onesignal-gradle-plugin:xxx'
通过范围(例如[0.11,0.99.99])捆绑在一起,就像他们的教程说的那样.
The actual reason why I got this error was the classpath 'gradle.plugin.com.onesignal:onesignal-gradle-plugin:x.x.x'
was bundled via range (i.e. [0.11, 0.99.99]) just like their tutorial says.
为什么?因为他们制作了新版本(0.11.0)并破坏了所有内容,所以我不得不手动指定以前的版本.真是气死我了!花了4个小时.
Why? Because they made a new version (0.11.0) and had broken everything, so I had to manually specify previous version. This is just infuriating! Spent 4 hours on this.
这篇关于如何修复错误无法更改Gradle中的配置策略?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!