This version of the Android Support plugin for IntelliJ IDEA or Android Studio cannot open this project, please retry with version 2021.1.1 or newer

解决

低版本的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

 

posted on   一叶舟鸣  阅读(44)  评论(0编辑  收藏  举报

相关博文:
阅读排行:
· 快收藏!一个技巧从此不再搞混缓存穿透和缓存击穿
· Blazor Hybrid适配到HarmonyOS系统
· 支付宝 IoT 设备入门宝典(下)设备经营篇
· 万字调研——AI生成内容检测
· 解决跨域问题的这6种方案,真香!
< 2025年3月 >
23 24 25 26 27 28 1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31 1 2 3 4 5

导航

统计

点击右上角即可分享
微信分享提示