Run the react ntive project, run to download gradle and report an error

1. Error content

Run the react ntive project, run to download gradle and report an error.

Two, error handling

The version of gradle and the version of the gradle plug-in need to correspond. If something is wrong, an error will be reported.
First confirm that the versions of the two meet the requirements.
One is:

/项目根目录/android/gradle/wrapper/gradle-wrapper.properties

The gradle version to be downloaded in the other is:

/项目根目录/android/build.gradle

Medium:

classpath("com.android.tools.build:gradle:3.5.2")

The gradle plug-in version.
Then there is the network problem. Downloading this usually requires a scientific Internet access. If there is a problem with the proxy, or the network is not working, it is easy to report an error.
My solution is to download this file in advance.
The download address can be viewed here:

/项目根目录/android/gradle/wrapper/gradle-wrapper.properties

This line of code in this file:

distributionUrl=https\://services.gradle.org/distributions/gradle-6.0.1-all.zip

It is the version and download address of gradle.
I downloaded it and put it in this folder, and then the configuration address in the project points to the downloaded address.
Please add a picture description
Then run the project again.

Guess you like

Origin blog.csdn.net/weixin_42349568/article/details/131851195