Android Studio记录问题:Unrecognized Android Studio (or Android Support plugin for IntelliJ IDEA) version

文章描述了遇到AndroidStudio或AndroidSupportplugin版本不被识别的问题,解决方案是将设置.gradle和build.gradle文件进行相应修改。具体包括将根项目名设为Setting,只保留:app模块,注释掉plugins块并添加buildscript以及指定gradle版本为4.2.1。此外,还包含了清理任务以删除构建目录。
摘要由CSDN通过智能技术生成

Unrecognized Android Studio or Android Support plugin for IntelliJ IDEA version '202.7660.26.42.7351085', please retry with version 2021.2.1 or newer.

报错

Unrecognized Android Studio (or Android Support plugin for IntelliJ IDEA) version ‘202.7660.26.42.7351085’, please retry with version 2021.2.1 or newer.
在这里插入图片描述

解决

低版本的android导入高版本的工程
7.3.1修改适配android 4.2.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'

build.gradle

注释掉原先的plugins{}
添加
buildscript {}
allprojects {}
task clean(type: Delete) {
delete rootProject.buildDir
}
重新build即没有报错

 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
}
  • 2
    点赞
  • 8
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值