0

I'm upgrading to Android Studio Arctic Fox and everything is going fine except for the Gradle update.

With distributionUrl=https\://services.gradle.org/distributions/gradle-6.9-all.zip everything works fine, but as soon as I move to distributionUrl=https\://services.gradle.org/distributions/gradle-7.1.1-bin.zip I get this error:

Caused by: org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed:

There are no more details than that.

I first made the move using the upgrade tool for AGP and got the same error so I looked at what all changed and tried one change at a time to see which one is causing the problem and it is the distributionUrl.

I know there are a lot of questions and answers for this MultipleCompilationErrorsException error but they are either very outdated or talk about things like misspellings.

Anyone have any idea what the issue could be or how I can get more details regarding this problem?

Edit: since I know a lot of answers recommend switching jdk. I am currently using 11 but also tried jdk 8, same problem.

Edit: running gradlew wrapper I get this error, hopefully that helps me fix it:

......maven-push.gradle': 46: unable to resolve class MavenDeployment
   @ line 46, column 34.
                     beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment) }
                                      ^

  1 error

Edit: An open source project I had as a module had an extra script and that seemed to be the issue, removing that file that I don't need has fixed it.

casolorz
  • 8,486
  • 19
  • 93
  • 200
  • When exactly do you get the error? When trying to run some a task? If so try running the task with `--stacktrace` and `--debug` flags (`./gradlew --stacktrace --debug task_name`) and post the full output. – jannis Aug 13 '21 at 09:16
  • I'm not running any tasks by hand. After doing the AGP upgrade Android Studio tries to do a Gradle sync and that is when the error shows up. That being said, if there is some way to replicate this by hand that would give more info, then that would help. – casolorz Aug 13 '21 at 12:50
  • Have you seen https://stackoverflow.com/questions/60474877/syncing-caused-by-org-codehaus-groovy-control-multiplecompilationerrorsexcept? Does any of the answers there work for you? – jannis Aug 13 '21 at 12:55
  • You could also try running a build from the console. With a `./gradlew wrapper` before that. – jannis Aug 13 '21 at 12:56
  • I'll try running it by hand. Like I mentioned, most of those answers on StackOverflow are for really old versions of Android Studio and they talk about JDK version, I already tried 8 and 11. – casolorz Aug 13 '21 at 14:22
  • Edited my post with the output of that command. Thanks. – casolorz Aug 13 '21 at 14:25
  • @jannis if you want to make an answer suggesting that I try the `./gradlew wrapper` command to get more info then I'll mark that as correct and award the bounty. – casolorz Aug 13 '21 at 14:41
  • I've added an answer draft, I'll edit it later. – jannis Aug 13 '21 at 16:19

2 Answers2

3

After changing the version in the properties file you still need to run ./gradlew wrapper to finalize the upgrade by downloading the upgraded Gradle wrapper. Then try running the build from within the console with --stacktrace --debug to debug the error more thoroughly.

jannis
  • 4,843
  • 1
  • 23
  • 53
1

I had the same problem.

In my case the problem was solved by editing gradlewrapper.properties file:

I changed distribution url from https\://services.gradle.org/distributions/gradle-7.1.1-bin.zip to https\://services.gradle.org/distributions/gradle-7.1.1-all.zip.

The problem is with bin which I changed to all.