Summary of gradle related issues

Question 1:Could not find method google() for arguments [] on repository container。

Because of the existence of a certain wall, google() and jcenter() are sometimes inaccessible, causing gradle to fail to solve the dependency problem.

The solution is to use Alibaba Cloud's mirror image instead. On the one hand, it can solve the dependency problem, and on the other hand, it can also improve the access speed. https://maven.aliyun.com/mvn/guide

warehouse name Alibaba Cloud warehouse address Alibaba Cloud warehouse address (old version) source address
central https://maven.aliyun.com/repository/central https://maven.aliyun.com/nexus/content/repositories/central https://repo1.maven.org/maven2/
jcenter https://maven.aliyun.com/repository/public https://maven.aliyun.com/nexus/content/repositories/jcenter http://jcenter.bintray.com/
public https://maven.aliyun.com/repository/public https://maven.aliyun.com/nexus/content/groups/public Aggregation warehouse of central warehouse and jcenter warehouse
google https://maven.aliyun.com/repository/google https://maven.aliyun.com/nexus/content/repositories/google https://maven.google.com/
gradle-plugin https://maven.aliyun.com/repository/gradle-plugin https://maven.aliyun.com/nexus/content/repositories/gradle-plugin https://plugins.gradle.org/m2/
spring https://maven.aliyun.com/repository/spring https://maven.aliyun.com/nexus/content/repositories/spring http://repo.spring.io/libs-milestone/
spring-plugin https://maven.aliyun.com/repository/spring-plugin https://maven.aliyun.com/nexus/content/repositories/spring-plugin http://repo.spring.io/plugins-release/
grails-core https://maven.aliyun.com/repository/grails-core https://maven.aliyun.com/nexus/content/repositories/grails-core https://repo.grails.org/grails/core
apache snapshots https://maven.aliyun.com/repository/apache-snapshots https://maven.aliyun.com/nexus/content/repositories/apache-snapshots https://repository.apache.org/snapshots/

Question 2:Could not initialize class org.codehaus.groovy.runtime.InvokerHelper

Since jdk is lower than 1.8 will cause this problem, upgrade the version of jdk,

Question 3:Unsupported major.minor version 52.0

Since jdk is equal to 1.8 will cause this problem, upgrade the version of jdk. But there may be a problem of too high version, such as jdk16 (60). It is recommended to find a suitable jdk version, generally jdk11 or jdk14

Question 4:Could not find com.android.tools.build:gradle:6.8

Some mirror warehouses do not contain the 6.8 version. Check the corresponding version under the corresponding path through https://maven.aliyun.com/mvn/view. Just modify it to the latest version. For example, 7.0.0.

Guess you like

Origin blog.csdn.net/u013741019/article/details/115309265