Error after upgrading platform from 6.3.5 to 6.3.6 with Studio 6.3.4?

I just downloaded the latest version of Studio (6.3.4) and the Platform (6.3.6). I took an existing project and changed it’s platform level in the Project Properties to 6.3.6.

Now, when I go into Intellij Idea, I get many errors. Going into the Module Properties on my web module, I see that all the cuba jars are still 6.3.5. I am also seeing many dependency errors in my core, global, gui, and web modules. They still say “Gradle: com.haulmont.cuba:cuba-core:6.3.5”.

I tried resetting my project back to 6.3.5, but I got an error :

:ideaModule
:ideaProject
:ideaWorkspace FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':ideaWorkspace'.
> No such field: size for class: org.codehaus.groovy.runtime.NullObject
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
BUILD FAILED
Total time: 0.957 secs
[11:23:42.880] Task 'idea' failed
groovy.lang.MissingFieldException: No such field: size for class: org.codehaus.groovy.runtime.NullObject
[11:24:05.301] Creating/updating IDEA project files
:prm-core:clean UP-TO-DATE
:prm-global:clean UP-TO-DATE
:prm-gui:clean UP-TO-DATE
:prm-web:clean UP-TO-DATE
BUILD SUCCESSFUL

Changing back to 6.3.6 from 6.3.5 gives this:

:ideaModule
:ideaProject
:ideaWorkspace FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':ideaWorkspace'.
> No such field: size for class: org.codehaus.groovy.runtime.NullObject
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
BUILD FAILED
Total time: 0.957 secs
[11:23:42.880] Task 'idea' failed
groovy.lang.MissingFieldException: No such field: size for class: org.codehaus.groovy.runtime.NullObject
[11:24:05.301] Creating/updating IDEA project files
:prm-core:clean UP-TO-DATE
:prm-global:clean UP-TO-DATE
:prm-gui:clean UP-TO-DATE
:prm-web:clean UP-TO-DATE
BUILD SUCCESSFUL
Total time: 0.913 secs

What is the correct way to upgrade the platform?

I think I managed to resolve this. I opened the Gradle Window in Intellij Idea and executed Refresh. My projects now seem to have cuba 6.3.6 listed in the dependencies.

Was this the correct solution?

It seems that gradle idea task that updates IDEA project files fails on your project for some reason. Do you use Gradle which is downloaded by Studio or a custom installation?

To be honest, I’m not sure. I don’t really know much about gradle.

When I run gradle -version from the command line, I get 3.2.1. If I go into settings in idea and search for gradle, it says that gradle home is /usr/lib/gradle/3.2.1.

So, I guess this means I’m using 3.2.1 all around and not the one installed with Studio, right?

Not necessarily. By default, Studio 6.3 downloads and uses Gradle 2.13, but you can specify your own installation of Gradle in Studio Server window > Advanced. So the question is, have you done it?

Strangely, I don’t see a Gradle option in my Cuba Studio 6.3.4 Project Properties->Advanced screen. And, on the main screen, I see an option for the Platform version but not for the Gradle version. I also don’t see anything on the Help->Settings screen.

The only place I can find anything Gradle related is in IDEA and in the build.gradle file. In IDEA, File->Settings->Build, Execution, Deployment->Gradle. There is a setting there for Gradle Home and mine is set for /usr/lib/gradle/3.2.1 (the one I installed).

In build.gradle, I see this:


task wrapper(type: Wrapper) {
    gradleVersion = '2.13'
}

It’s in Studio server window, not in its web UI. Perhaps you didn’t change it, so the default is used.

Please let us know if you have this problem in the future.

OOOHHHH!!! I get it now! :slight_smile: I did NOT change that setting. It is blank.

Is the problem the mismatch between the IDEA settings and the Studio Server settings?

Is the problem the mismatch between the IDEA settings and the Studio Server settings?

No, IDEA settings do not affect regeneration of project files. We normally do not use IDEA facilities for Gradle at all. When you create/update IDEA project files via Studio menu or in command line by gradle idea, Gradle creates all necessary information for IDEA, and nothing is required from IDEA-Gradle integration. It’s like a one-way process: from your build.gradle to the IDE.

Well, that’s strange then. I will watch for the next update to see what happens. Thanks for the help!