Question 1:Could not find method google() for arguments [] on repository container。
因为某个墙的存在,google()和jcenter()有时候无法访问,导致gradle无法解决依赖问题。
解决办法,使用阿里云的镜像替代,一方面可以解决依赖问题,另一方面也提高了访问速度。https://maven.aliyun.com/mvn/guide
仓库名称 | 阿里云仓库地址 | 阿里云仓库地址(老版) | 源地址 |
---|---|---|---|
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 | central仓和jcenter仓的聚合仓 |
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
由于jdk低于1.8会导致此问题,升级jdk的版本,
Question 3:Unsupported major.minor version 52.0
由于jdk等于1.8会导致此问题,升级jdk的版本。但是可能存在版本过高问题,例如jdk16(60)。建议找到合适的jdk版本,一般是jdk11或者jdk14
Question 4:Could not find com.android.tools.build:gradle:6.8
有的镜像仓库不一样包含6.8 版本。通过https://maven.aliyun.com/mvn/view 查看对应路径下对应的版本。修改为最近的版本即可。例如7.0.0,。