gradle issues details in discription - android-gradle-plugin

Unable to find method 'org.gradle.api.artifacts.result.ComponentSelectionReason.getDescription()Ljava/lang/String;'.
Possible causes for this unexpected error include:
Gradle's dependency cache may be corrupt (this sometimes occurs after a network connection timeout.)
Re-download dependencies and sync project (requires network)
The state of a Gradle build process (daemon) may be corrupt. Stopping all Gradle daemons may solve this problem.
Stop Gradle build processes (requires restart)
Your project may be using a third-party plugin which is not compatible with the other plugins in the project or the version of Gradle requested by the project.
In the case of corrupt Gradle processes, you can also try closing the IDE and then killing all Java processes.

I resolved the error by downgrading gradle.
To do so, in the gradle-wrapper.properties file, I made the following changes.
It was:
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.0.2-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
It is now:
distributionUrl=https\://services.gradle.org/distributions/gradle-6.8.3-all.zip
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStorePath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME

If you are using IntelliJ Community Edition, upgrading the IDE to IntelliJ IDEA 2021.1.2 (Community Edition) solved the problem for me. Previously I was using the 2019 version and I was getting the same error.

I had the same problem. I solved it, when I update Android Studio with Gradle.

Upgrading IntelliJ version from 2019 to 2021 fixed the issue for me

org.gradle.internal.exceptions.LocationAwareException:
'java.lang.String
org.gradle.api.tasks.SourceSet.getCompileConfigurationName()'
Caused by: java.lang.NoSuchMethodError: 'java.lang.String
org.gradle.api.tasks.SourceSet.getCompileConfigurationName()'
I got the same error mentioned in the question with the above exceptions.
As mentioned above, upgrading the intellij version from from 2019 to 2021 helped me.

Upgrading Intellij version worked.

Either upgrade or downgrade your IntelliJ idea. Stupid but that's the way to go. I jumped between 2021.3.2, 2019.3.1, 2021.1.2 and some version of 2022 however, downgrading to 2021.1.3 fixed my issue. It all started after I changed my hdd and downloaded the latest version intellij idea.

Related

Problem in running a project with aspectJ in IntelliJ IDEA 2022.2.3 (Community Edition)

I am trying to run a project with aspectJ, rather than Java, in IntelliJ IDEA. I had done it before by simply putting "aspectj-1.9.6" in a "Lib" folder and setting the folder "as Library". But I tried it again today and it is not working. I think it might be because I have updated my IntelliJ to version "2022.2.3". I saw in this link that for intelliJ version "2021.1", one should select "ajc" as the project compiler in IntellJ. But it seems that there is no such compiler option in IntelliJ version "2022.2" (as I looked at this link and also searched in this link).
I also tried to install and enable "AspectJ weaver" plugin, but I encounter the following error: "Plugin 'AspectJ weaver' failed to initialize and will be disabled. Please restart IntelliJ IDEA.". Someone has had the same problem in this post, but the answer doesn't work for me, as it refers to this link, which is not compatible with IntelliJ version 2022.2.3:
So, I wonder whether aspectJ is not supported any more in IntelliJ?
Does any one has any suggestion that I could use it with this version of IntelliJ? I do really appreciate any help.
Thanks in advance
IntelliJ IDEA is compatible with AspectJ. I am running the plugin on 2022.2.3 without any problems. But I use IDEA Ultimate, you use Community. Did you notice this in your screenshot?
Compatible with IntelliJ IDEA Ultimate

IntelliJ Error:Kotlin: Module was compiled

I have used IntelliJ IDE just for Spring Boot project. Strong NOTE that I have not used any Kotlin project. But, today, I have an error below. Any professional person. Please, HELP to solve this issue! Thanks,
Error:Kotlin: Module was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.5.1, expected version is 1.1.13.
I ran into the same problem, and my solution was:
If you do not use Kotlin in your project, you can solve the problem by turning off the IntelliJ IDE plugin.The operation is as follows:
idea menu:File>Setting>Plugins
Operation flow chart
According to solution from: https://stackoverflow.com/a/71093698/13248380
Try going to Build menu and choose Rebuild project.

Lombok incompatible with IntelliJ 2020.2

After the last update to IntelliJ 2020.2 i get the Error:
Plugin "Lombok" is incompatible (until build 201.SNAPSHOT < IC-202.6397.94).
I've searched for the problem, but it seems that i'm the only one who has the problem with this IntelliJ version.
The solution for me was:
Uninstall Lombok Plugin
Invalidate Caches & Restart
Install Lombok plugin 0.30 EAP
Invalidate Caches & Restart
Additional issues mentioned here.
I made an update this morning. Everything works. Intellj indicates that it is not compatible, but treats it correctly when updating. The validation of Intellj is incorrect because Lombok delivers the compatibility in the same version.
See: https://plugins.jetbrains.com/plugin/6317-lombok
A new version of lombok was released here:
Lombok
Just download the .jar file and install the plugin from disk.
It seems that IntelliJ is not installing automatically new version of lombok plugin.
Let's uninstall -> restart IDE -> Install Lombok plugin. (now you will have new version installed)
I had the same problem for 3 plugins, I solved by:
File -> Invalidated caches / restart
The plugin is incompatible with the new version of IntelliJ.
Before validating update to version 2020.2 IntelliJ displays a message of incompatibles plugins and Lombok is one of them:
You have the option to go back to IntelliJ version 2020.1 and wait for an update of Lombok
Just take the last Intellij 2020.2 RC build (which fix this bug) on : https://confluence.jetbrains.com/display/IDEADEV/IDEA+2020.2+latest+builds
And be careful to also install last lombok intellij plugin (0.30.1).
This issue is detailed on https://github.com/mplushnikov/lombok-intellij-plugin/issues/649 and is not entirelly the fault of the plugin (that's why intellij RC must be also installed)
Obviously this solution should be preferred while waiting for a final Intellij 2020.2.1 version.
More detailled information on https://youtrack.jetbrains.com/issue/IDEA-248146 (minimum build version for fix is IntelliJ IDEA 2020.2.1 RC Build #IC-202.6948.36, built on August 18, 2020)
A new version of the Lombok plugin is bundled with newer versions of IntelliJ. If you have an older version of the plugin already installed and you upgrade IntelliJ, IntelliJ may get stuck in a state that requires manually uninstalling the older plugin.
It appears this is because the older Lombok plugin is incompatible with the newer version of IntelliJ, and the newer plugin is bundled, so it can neither be uninstalled nor upgraded. However, they are not properly treated as two separate plugins, resulting in a plugin incompatible with the installed version of IntelliJ, can't be upgraded, and can't be uninstalled.
To get rid of this conflict:
stop IntelliJ
delete the plugin directory from the file system; If you have Jetbrains Toolbox, go to IntelliJ IDEA settings, and copy the install location. Remove the Lombok plugin directory rm -rf lombok-plugin
start IntelliJ
feel free to enable the Lombok plugin, and this would be the bundled one now.
Installed latest version(2020.3) of intellij and issue resolved for me.
I basically had to reinstall it twice. This is what I did to resolve the issue:
Uninstall the plugin
Invalidate caches and restart
Install the plugin (issue remained)
Uninstalled the plugin a second time
Restart (no invalidate cache this time)
Install plugin again (issue resolved)
I think someone else mentioned that the plugin does not get installed correctly the first time.

React Native "Could not open settings remapped class cache"

I received this error:
FAILURE: Build failed with an exception.
* What went wrong:
Could not open settings remapped class cache for 1a8j0dwq37525yzi9alfmzw3 (C:\Users\Username\.gradle\caches\5.4.1\scripts-remapped\settings_7z9efzwj1mz1b0w35o6u5p4ep\1a8j0dwq37525yzi9alfmzw3\settingsdcd040730888da95d185715568c9cc57).
> Could not open settings generic class cache for settings file 'PATH\android\settings.gradle' (C:\Users\Username\.gradle\caches\5.4.1\scripts\1a8j0dwq37525yzi9alfmzw3\settings\settingsdcd040730888da95d185715568c9cc57).
> BUG! exception in phase 'semantic analysis' in source unit '_BuildScript_' Unsupported class file major version 57
Yesterday I tried to add the Google Login Package and received similar errors. Then I pulled a working version from my Github Repository and now I get this error. Already cleaned Gradle, reinstalled Java, deleted Cache, "Restart and delete" with Android Studio... Has anybody an idea?
Thanks in advance
Had the same problem. Here's how i solved this.
Go to android > gradle > > wrapper > gradle-wrapper.properties file and find distributionUrl and at the end of that line you'll find gradle-5.2-all.zip kind of gradle version. This version can be diffrent in your case. just change it to latest gradle version. In my case latest version is 6.7 so i changed version like this.
Before
distributionUrl=https\://services.gradle.org/distributions/gradle-5.2-all.zip
After
distributionUrl=https\://services.gradle.org/distributions/gradle-6.7-all.zip
Goto this directory :C:\Users\your username.gradle\caches
Rename the gradle in question and then go and run 'react-native run-android' again your problem should be resolved!
For me, the removal of the cache didn't solve the problem.
I opened Android Studio and ran the Gradle build process. It downloaded the correct libraries and then react-native run-android ran flawlessly.
Please Change your distributionUrl (android > gradle > > wrapper > gradle-wrapper.properties) to:
Depend on ion your JDK version(your jdk version and Gradle version should related)...
My JDK: 18
👉 distributionUrl=https://services.gradle.org/distributions/gradle-7.3.3-all.zip
(: Worked :)
Required:
JDK 18+
If you have a low version of JDK downgrade your gradle version. (ex, distributionUrl=https://services.gradle.org/distributions/gradle-6.3-all.zip)

IntelliJ not reflecting Maven dependencies

I recently updated my IntelliJ and I am having a problem with it showing import statements as nonexistent in the classpath despite the project building fine by doing mvn clean [install|verify] from the command line and the software actually works. So the dependencies are certainly there but the IDE seems to have a bug synchronizing against the pom file. I have tried to Maven --> Reimport multiple times, without success.
Considering that I recently updated IntelliJ (the version is as of 7/15/2017), could this be a newly introduced bug and is there a workaround?
The problem may be caused by a known bug in Maven integration which affects 2017.2 version. This bug is fixed in 2017.2.1 version.
You can find out if it's the case of your problem by searching idea.log for:
java.lang.AbstractMethodError: org.jetbrains.idea.maven.server.embedder.CustomModelValidator$ProxyModelProblemCollector.add(Lorg/apache/maven/model/building/ModelProblemCollectorRequest;)V