解决
低版本的android导入高版本的工程
7.2修改适配android 4.2.1
1、setting.gradle
保留rootProject.name = ""和include ‘:app’,其余注释
//pluginManagement { // repositories { // gradlePluginPortal() // google() // mavenCentral() // } //} //dependencyResolutionManagement { // repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS) // repositories { // google() // mavenCentral() // } //} rootProject.name = "Setting" include ':app'
2、build.gradle
注释掉原先的plugins{}
添加
buildscript {}
allprojects {}
task clean(type: Delete) {
delete rootProject.buildDir
}
Top-level build file where you can add configuration options common to all sub-projects/modules. //plugins { // id 'com.android.application' version '7.3.1' apply false // id 'com.android.library' version '7.3.1' apply false //} // Top-level build file where you can add configuration options common to all sub-projects/modules. buildscript { repositories { google() mavenCentral() } dependencies { classpath "com.android.tools.build:gradle:4.2.1" // NOTE: Do not place your application dependencies here; they belong // in the individual module build.gradle files } } allprojects { repositories { google() mavenCentral() jcenter() // Warning: this repository is going to shut down soon } } task clean(type: Delete) { delete rootProject.buildDir }
重新build即没有报错。
参考:Android Studio记录问题:Unrecognized Android Studio (or Android Support plugin for IntelliJ IDEA) version
标签:2021.1,repositories,version,Studio,build,Android,android From: https://www.cnblogs.com/yiyezhouming/p/18245648