I am new in Android Studio. After setup, When I am trying to import an application I am getting that error So that gradle not able to build.
Error:Could not
I fixed it just by editing the gradle-wrapper.properties
file.
You must go to the project folder, then /android/grandle/wrapper/gradle-wrapper.properties
.
In DistributionUrl, change to https \: //services.gradle.org/distributions/gradle-6.4.1-all.zip
.
This is because of the gradle version.
Go to: gradle/wrapper/gradle-wrapper.properties
.
Change a version of the course by this:
distributionUrl=https\://services.gradle.org/distributions/gradle-6.3-all.zip
The console outputs:
Welcome to Gradle 6.3!
Here are the highlights of this release:
- Java 14 support
- Improved error messages for unexpected failures
For more details see https://docs.gradle.org/6.3/release-notes.html
Starting a Gradle Daemon (subsequent builds will be faster)
For me the solution was to upgrade the gradle version to 6.3 from the android project structure (java 14.0.1 is already installed on my pc).
The problem in my case was in the discrepancy between the Gradle version installed globally and the one required by React Native. To fix it, I had to update the folder android/gradle/wrapper
from the current 6.5 RN version from GH.
I'm using Pop OS 20.04 and I have Java versions 8, 11 and 14 installed on my notebook.
This error was happening to me when version 14 was standard.
When I switched to using version 11 as the default, the error no longer occurred.
sudo update-alternatives --config java
In gradle-wrapper.properties file, updating the Gradle to 6.3 solved the problem on Mac OS Catalina
distributionUrl=https://services.gradle.org/distributions/gradle-6.3-bin.zip