Gradle Sync/Auto-refresh failure
Answered
Whenever I click the auto-refresh button in my Gradle projects window, it gives me this error: "Error: Cannot set the value of read-only property 'name' for object of type org.gradle.api.publish.maven.internal.publication.DefaultMavenPublication."
I've double-checked the build.gradle file and there is no line where I'm trying to set the name property of DefaultMavenPublication.
Details
OS: MacOS 10.13.4
IDE: IntelliJ 2017.1.6
Gradle version: 4.4
Please sign in to leave a comment.
Ok, this issue has been resolved. For anyone having similar issues, try moving your project to an entirely new directory.
I got exactly the same issue with Intellij 2018.2, Gradle 4.8. Could you please be more specific? What do you mean by "moving project to an entirely new directory"?
Hey, so I started experiencing the issue intermittently. Although moving to a new directory fixed it once, the issue kept reappearing for me. In the end, downgrading to IntelliJ 2017.1.6 resolved the issue for me. If that is not an option for you, I encourage you to contact JetBrains technical support.
Another thing to do would be to make sure that you're using the most recent version of your gradle plugins.
Can the project be built from command line by Gradle? Have you tried re-importing it from Gradle (File | New | Project from Existing Sources... action and select main build.gradle file).
Also try using different Gradle version in IDE gradle settings.