After the updating the new version of Android Studio ,I am facing the error message in our Android Studio.
**> Unsupported Gradle.
> The project uses Gradle version which is incompatible with Android Studio 2021.3.
>
> Possible solution:
> Open Gradle wrapper settings, upgrade version to 3.0 or newer and reload the project
> **
I am try to solve bit it had not solved.
I created new project because I think it is temporary error but after all is has not solved the issue.
I would recommend updating Gradle for your project.
You can execute the follwing commands from the command line (in the root directory of your project), or you can just click on the "terminal" tab at the bottom of Android studio.
First, check your Gradle version:
./gradlew --version
You will get a lot of results, but you only care about the line that says something like this:
------------------------------------------------------------
Gradle 7.4
------------------------------------------------------------
Assuming you are on an earlier version of Gradle, you can update to the latest by using the following command (replacing '7.6' with the version you wish to use):
./gradlew wrapper --gradle-version 7.6
Depending on your project, that should be all you need. If you have incompatabilities with your code and the version of Gradle, Android studio should issue you further guidance.
Related
I am trying to build my java springboot cod using gradle 7 but getting this error while requires Gradle 6.8.x, 6.9.x, or 7.x. The current version is Gradle 5.6. How can i get the latest version of gradle
Hard to tell without much details on the build failure. I had issues myself trying to build in CodeBuild with gradle 7 and I solved by:
Make sure the source code pulled by CodeBuild contains the gradle/wrapper folder and all its contents (including the jar file).
Check in the gradle-wrapper.properties have the distributionUrl to the gradle distribution for your project.
Use ./gradlew build as a command in CodeBuild.
Can't build react native app in android studio.
I tried:
Sync Project with Gradle Files, but I can't do it because of an
error
File -> Invalidate Caches/ Restart
Clear cache from $HOME/.gradle
Delete $HOME/.gradle
Change com.android.tools.build:gradle version on 2.3.0, because it's
the latest version in this list
(https://repo.jfrog.org/artifactory/libs-release-bintray/com/android/tools/build/gradle/), but when I use npx react-native init projectName, used Android Plugin Version 4.1.2, but this version there isn't in this list.
Also know the difference between Gradle, Android Gradle Plugin,
Gradle Wrapper, already read https://developer.android.google.cn/studio/releases/gradle-plugin?hl=en. I tryied to use the latest Gradle v. 6.8.2 and Android Gradle Plugin v. 4.1.2, it also didn't help to build the project.
Change distributionUrl in
projectName/android/gradle/wrapper/gradle-wrapper.properties
Change in File->Settings->Build, Execution, Deployment->Gradle use
Gradle from Specified location and set C:/Gradle/gradle-6.8.2, it didn't help and left it at default
I know there are exactly the same questions on stackoverflow and on github, but the solutions haven't helped.
Build output:
Could not find com.android.tools.build:gradle:4.1.1.
Searched in the following locations:
- https://jcenter.bintray.com/com/android/tools/build/gradle/4.1.1/gradle-4.1.1.pom
If the artifact you are trying to retrieve can be found in the repository but without metadata in 'Maven POM' format, you need to adjust the 'metadataSources { ... }' of the repository declaration.
Required by:
project :react-native-settings
Add google Maven repository and sync project
Open File
Now used:
Gradle v. 6.5
Android Gradle Plugin v. 4.1.2
gradle-wrapper 6.5-all
Android Studios 4.1.2
Android SDK Platform: Android 10, 9, 8.1, 8.0, 7.1.1, 7.0
Your google Maven library is missing. Rebuild project after adding it
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)
I need help.
I can't upgrade gradle version of my react-native project.
I try a lot of things, downloaded last version of Android Studio & SDK Tools etc.
I changed this file \android\gradle\wrapper\gradle-wrapper.properties, I tried to upgrade using npm install -g react-native-git-upgrade but still I can't upgrade it.
When I react-native eject It's exports
"distributionUrl=https://services.gradle.org/distributions/gradle-2.14.1-all.zip"
Waiting for answers.
In android/build.gradle you have to edit this line
classpath 'com.android.tools.build:gradle:x.y.z'
Change x.y.z with the version you want. Edit it with Android Studio then click Sync now
In {yourProject}\android\gradle\wrapper\gradle-wrapper.properties, update:
distributionUrl=https\://services.gradle.org/distributions/gradle-{your version}.zip
Find your version of gradle with
gradle --version
You may need to install gradle wrapper if you haven't already.
you can go to https://services.gradle.org/distributions/ and check that latest -all.zip version of gradle and update the same in your gradle-wrapper.properties file. When you run your react-native app the next time, your gradle will first get upgraded and then run.
There are two things
Android Gradle Plugin
You can see the version of it in android/build.gradle file and update it using Daniel's answer here
Gradle version
You can see this in android\gradle\wrapper\gradle-wrapper.properties file and update it using the answer mentioned here
To know the difference between them refer following links:
https://developer.android.com/studio/releases/gradle-plugin
difference between android gradle plugin and gradle
Open Android Studio and navigate to File → Project Structure
Then click on the Project option.
then choose the latest version of Gradle. After that click on Ok.
From Gradle's site:
https://gradle.org/install/#with-the-gradle-wrapper
Upgrade with the Gradle Wrapper If your existing Gradle-based build
uses the Gradle Wrapper, you can easily upgrade by running the wrapper
task, specifying the desired Gradle version:
$ ./gradlew wrapper --gradle-version=6.6.1 --distribution-type=bin
Note that it is not necessary for Gradle to be installed to use the
Gradle wrapper. The next invocation of gradlew or gradlew.bat will
download and cache the specified version of Gradle.
$ ./gradlew tasks
Downloading https://services.gradle.org/distributions/gradle-6.6.1-bin.zip ...
Run these commands in your project's android folder
I had opened my project in Terminal and ran open -a /Applications/Android\ Studio.app to open Android Studio but so that it can access node to download my gradle version which it did automatically.
Learned from this original post: React Native on Android: Cannot run program "node": error=2, No such file or directory
For react native
Go to File -> Project Structure -> Change gradle version to 6.1.1 plugin version to 4.0.0
Try different combinations
Use this link - https://developer.android.com/studio/releases/gradle-plugin.html#updating-gradle
ext:
OS: window8 x64
android studio 2.1.3
gradle plugin 2.1.3
gradle 2.14.1
I have already download gradle-2.14.1.zip when compile project last time, use git clone project from github, modify graldw-plugin version and distributionUrl=https\://services.gradle.org/distributions/gradle-2.14.1-all.zip in graldle-wrapper.properties
In embed Terminal run gradlew build it download gradle again,like this(sorry pic not allow enbed) (redundant file take up more C disk rest space) how to solve?