After updating IntelliJ and pulling the newest code from the repo for my project, I keep getting build errors like Kotlin: Unresolved reference, Kotlin: Too many arguments for public fun, etc., that I wasn't getting before.
I am trying to run Reload All Gradle Projects through IntelliJ, but then I keep getting the following error:
[daemon] Invalid maximum heap size: -Xmx1g -Xshare:off
I was able to build project fine for the past few months, but now when I have pulled the latest from the remote repo I keep getting that error when I try to Reload All Gradle Projects.
This is how my gradle.properties file looks like:
org.gradle.caching=true
org.gradle.parallel=true
org.gradle.jvmargs=-Xms512M -Xmx2g -XX:MaxMetaspaceSize=1g -Xshare:off -Dkotlin.daemon.jvm.options="-Xmx1g -Xshare:off"
org.gradle.logging.level=lifecycle
org.gradle.console=auto
Since it is a part of our git repo, I am afraid to do any changes there. I have read that it could be an issue with having 32 bit JDK instead of the 64 bit, but I have the right version:
openjdk version "17.0.3" 2022-04-19
OpenJDK Runtime Environment Temurin-17.0.3+7 (build 17.0.3+7)
OpenJDK 64-Bit Server VM Temurin-17.0.3+7 (build 17.0.3+7, mixed mode, sharing)
Even if I comment out the org.gradle.jvmargs in gradle.properties file, I get build errors:
Redeclaration: Glow_kotlinAppConventionsPlugin
I have tried to run ./gradlew clean from terminal as well, but that didn't help.
I have also increased the Shared build process heap size from 1400 to 4000 Mbytes in IntelliJ -> Preferences -> Build, Execution, Deployment -> Compiler. That didn't help either.
I have tried with going through IntelliJ's Repair IDE steps, but that gave me the same errors when I was trying to rebuild project.
I am running out of ideas, how can I solve this issue and why has it all of a sudden appeared?