Plugin [id: 'com.android.application', version: '7.*.*', apply: false] was not found solution

        Woohoo~ I encountered the following situation after creating a new project File->New->New Project->Empty Activity: Plugin [id: 'com.android.application', version: '7.2.2', apply: false] was not found in any of the following sources:

Question 1: Proxy is configured

Set File | Settings | Appearance & Behavior | System Settings | HTTP Proxy to No proxy,

Comment out the proxy configuration code in Gradle Scripts | gradle.properties, refer to:

Under the new project, Gradle sync reports an error Plugin was not found in any of the following sources

Problem 2: Gradle path configuration error

Under normal circumstances, Android Studio will automatically download the Gradle build tool. Generally, it will be downloaded to the C drive -> user -> (under the computer account name directory) by default. At this time, there will be a .gradle directory. Note that there is also a .gradle directory in the downloaded SDK. You need to ensure that the Gradle user home: under the File | Settings | Build, Execution, Deployment | Build Tools | Gradle path of Android Studio is set to the .gradle directory of the C drive, so this problem has been solved.

.gradle can also be migrated from the C disk to other disks, which will not be described here. You can refer to:

Android Studio configures the .android and .gradle of the C drive to other drives

Question 3: There is no gradle package under the .gradle folder or the package is not available

The cause of packet loss may be that it was accidentally deleted manually, and it will usually be downloaded automatically (the network speed of visiting foreign sites will be very slow, and manual download is also available). If it is not available, the package will not be updated automatically, which will cause an error. In this case, you need to manually download the corresponding version of the package from the official website to replace it.

Open the Gradle Scripts | gradle-wrapper.properties directory of Android Studio, the distributionUrl item records the address of the official website and the version of the corresponding package, download it in the browser, and return to C:\Users\(account name)\.gradle\wrapper\dists \gradle-7.3.3-bin\6a41zxkdtcxs8rphpq6y0069z (the last long list of directory names is random), the compressed package will be replaced without decompression, and the system will complete it automatically.

 After the modification, click Try Again in the blue box above. If not, you can also click File->Sync Project with Gradle Files, and the problem is solved.

 

 

Supongo que te gusta

Origin blog.csdn.net/qq_53375075/article/details/126562829
Recomendado
Clasificación