cannot resolve symbol GradleException问题
将GradleException换成FileNotFoundException
[Plugin with id ‘com.android.application‘ not found]
添加
buildscript {
repositories {
google()
mavenCentral() // or jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:7.2.2'
}
}
3.错误
Failed to resolve: com.github.chrisbanes:PhotoView:latest.release.here
Show in Project Structure dialog
Show Details
Affected Modules: common
gradle7 以上版本配置maven 库。报上述错误需要如下解决
在项目根路径下的build.gradle中配置:
buildscript {
repositories {
mavenCentral()
google()
//添加阿里云镜像,不添加无法拉取包
maven { url "https://maven.aliyun.com/repository/public" }
maven { url "https://maven.aliyun.com/mvn/view" }
maven { url "https://jitpack.io" }
}
dependencies {
classpath 'com.android.tools.build:gradle:7.2.0'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
在setting.gradle配置文件中配置:
dependencyResolutionManagement {
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
repositories {
google()
mavenCentral()
maven { url "https://maven.aliyun.com/repository/public" }
maven { url "https://maven.aliyun.com/mvn/view" }
maven { url "https://jitpack.io" }
}
}