Gradle settings error - intellij-idea

Error:The project is using an unsupported version of Gradle. Please use version 1.10.
Please point to a supported Gradle version in the project's Gradle settings or in the project's Gradle wrapper (if applicable.)
Gradle settings
how to resolve above qouery ?

Duplicate of a question raised at Gradle forum - http://forums.gradle.org/gradle/topics/gradle_settings_error
It is not a query but an error statement and it tells you what to do.

Related

Kotlin 5.21 in IntelliJ IDEA

I have imported an existing Maven project into IntelliJ IDEA 2021.2. The Maven project uses Kotlin version 1.5.21. However, I get a warning that the version in Maven is incompatible with the version of the IntelliJ plugin, which is 1.5.10 and is the latest available. Is there a way to use Kotlin 1.5.21 in the latest version of IDEA?
Try Settings > Languages & Frameworks > Kotlin > Update channel > Early Access Preview 1.5.x
I don't think the difference in version really matters, but this might be interesting for you.
You can't update to the newest version of Kotlin plugin on 2021.2 for now. See - https://youtrack.jetbrains.com/issue/KTIJ-18848

IntelliJ error - could not open init generic class cache for initialization script

enter image description here
enter image description here
I was trying to download IntelliJ and learn Kotlin, but i get a BUG error before i am starting, and i dont now what to do..
I have try to delete the scipts folder, but it just make a new scipts folder, and say the same error. I have also reinstall IntelliJ, and thats give the same error.
Is der someone there can help me? :-)
Could not open init generic class cache for initialization script 'C:\Users\username\AppData\Local\Temp\wrapper_init4.gradle' (C:\Users\username.gradle\caches\6.6.1\scripts\3yb5naxddghzghazzdf2vk0em).
BUG! exception in phase 'semantic analysis' in source unit 'BuildScript' Unsupported class file major version 60
As per the details in your error message, you can see that the root cause is a gradle error.
Gradle is likely using an unsupported version of the JVM in your case (e.g. I could reproduce the error in the latest IntelliJ 2021.3 version where gradle was using JVM 17 from my home path, while the IDE itself was using JDK 11.) In the attached IntelliJ Preferences screen, note that the JVM used by Gradle is specified separately.
To fix the error, verify the JVM version being used by gradle and specify a JVM 11 version to gradle.
IntelliJ Gradle Preferences Screenshot:
You should set these options when you create your project enter image description here
Or, when creating a project, choose Java - Kotlin\JVM
For me this problem occurred when i was using wrong JDK file to build the project that is the Gradle JDK used was a normal SE JDK rather than one preferred by Android Studio so you follow the following steps to solve it.
Go to Settings (ctrl + alt + s)
Go to Build,Execution and Deployment
Then select Build Tools > Gradle
Change Gradle JDK to jbr-17 (the one i am using) you can prefer to choose options from Android studio Java Home or Default JDK

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)

Robolectric 4 AndroidX NoClassDefFoundError MonitoringInstrumentation with IntelliJ 2018.3.4

Problem
after switching to androidX
with a multi-module Android library
using IntelliJ 2018.3.4 #IC-183.5429.30
using Robolectric 4.1 with android gradle plugin 3.3.1
when executing Robolectric tests, I receive:
java.lang.NoClassDefFoundError: androidx/test/runner/MonitoringInstrumentation
No duplicate question:
I read the other topics which pop up when using google or stackoverflow search but they are about a more specific error which is worked-around via adding specific dependencies. In my case I was not able to determine which dependency to add.
I add dependencies to androidx.test:core
for the build type under test.
In my case it was debug so in the build.gradle I add
debugImplementation 'androidx.test:core:1.2.0'
I read that no workaround should be required with Android Studio 3.3 and Robolectric 4.0.
Use Android Studio 3.3.1+ with Robolectric 4.0+
This works for me.

Error:Execution failed for task ':app:processDebugGoogleServices'. in Android Studio

I have got following error while adding dependency in build.gradle
Error:Execution failed for task ':app:processDebugGoogleServices'.
> Please fix the version conflict either by updating the version of the google-services plugin (information about the latest version is available at https://bintray.com/android/android-tools/com.google.gms.google-services/) or updating the version of com.google.android.gms to 8.3.0.
I have added following dependency and plugin to build.gradle(app level) to integrate GCM 3:-
apply plugin: 'com.google.gms.google-services'
compile "com.google.android.gms:play-services:8.3.0"
build.gradle(Top Level):-
classpath 'com.google.gms:google-services:1.5.0-beta2'
Your advice will be appreciated.
Thank you!
After debug and search in google I came to know that I have added dependency of google play service in build.gradle with two different versions.
Remove the older one solves this issue
Thank you