AndroidStudio中“com.android.tools.build.gradle7.1.0”错误
创始人
2024-08-21 10:00:09
0
  1. 升级 Gradle 版本:在项目根目录下的 build.gradle 文件中修改 Gradle 版本。示例:
buildscript {
    repositories {
        google()
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:7.2.0' // 修改版本号为 7.2.0 或更新版本
    }
}
  1. 升级 Android Gradle 插件版本:修改 app 下的 build.gradle 文件中的版本号,如下所示:
plugins {
    id 'com.android.application'
}

android {
    compileSdkVersion 31
    buildToolsVersion "31.0.0"

    defaultConfig {
        applicationId "com.example.myapplication"
        minSdkVersion 21
        targetSdkVersion 31
        versionCode 1
        versionName "1.0"

        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
    }

    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    implementation 'androidx.appcompat:appcompat:1.4.0'
    implementation 'androidx.constraintlayout:constraintlayout:2.1.1'
    testImplementation 'junit:junit:4.13.2'
    androidTestImplementation 'androidx.test.ext:junit:1.1.3'
    androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
}

// 修改以下代码(minSdkVersion 和 targetSdkVersion 可能需要根据具体情况调整)
android {
    compileSdkVersion 31
    buildToolsVersion "31.0.0"

    defaultConfig {
        applicationId "com.example.myapplication"
        minSdkVersion 21
        targetSdkVersion 31
        versionCode 1
        versionName "1.0"

        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
    }
    ...
    // 将以下部分的版本号修改为 7.2.0 或更新版本
    buildFeatures {
        viewBinding true
    }

    compileOptions {
        sourceCompatibility JavaVersion.VERSION_11
        targetCompatibility JavaVersion.VERSION_11
    }

    lintOptions {
        checkReleaseBuilds false
        abortOnError false
    }
}

相关内容

热门资讯

透视科技!wepoke软件透明... 透视科技!wepoke软件透明挂(透视)外挂透视辅助脚本(2021已更新)(哔哩哔哩),您好,wep...
5分钟了解(wpk安卓版本)外... wpk安卓版本高级策略深度解析‌;5分钟了解(wpk安卓版本)外挂透视辅助APP(辅助挂)透视辅助(...
教程攻略!微扑克软件的规律,n... 教程攻略!微扑克软件的规律,nzt德州原来真的有挂,细节揭秘(有挂教学)-哔哩哔哩;支持2-10人实...
7分钟普及!jj斗地主有手机挂... 7分钟普及!jj斗地主有手机挂,手机人海斗牛辅助器通用版,黑科技教程(有挂存在)1、jj斗地主系统规...
信息共享!wepoke小技巧(... 信息共享!wepoke小技巧(辅助挂)软件透明挂辅助机制(2024已更新)(哔哩哔哩)是一款可以让一...
玩家必知教程(WPK代码)外挂... 玩家必知教程(WPK代码)外挂透视辅助软件(辅助挂)透视辅助(2020已更新)(哔哩哔哩);WPK代...
玩家必看攻略!aapoker外... 玩家必看攻略!aapoker外挂实测,wpk下载反正真的有挂,存在挂教程(有挂透明)-哔哩哔哩1、点...
4分钟科普!中至江西云山510... 1、4分钟科普!中至江西云山510k外挂(辅助挂)外挂透视辅助工具(2021已更新)(哔哩哔哩);详...
玩家必用!ai机器人代打德州(... 玩家必用!ai机器人代打德州(辅助挂)其实真的有挂2024已更新)(哔哩哔哩)是一款可以让一直输的玩...
科技介绍(云扑克德州PK)软件... 科技介绍(云扑克德州PK)软件透明挂辅助工具(辅助挂)安装教程(2021已更新)(哔哩哔哩);原来确...