Android Studio 3.2 - Could not find com.android.tools.build:aapt2:3.2.0-4818971

前端 未结 6 538
一向
一向 2020-12-05 12:50

I was following a tutorial to develop icon pack for android and when I imported the project I got several errors and it was solved here - Gradle Version 4.6 - Absolute path

6条回答
  •  死守一世寂寞
    2020-12-05 13:37

    When you upgrade to 4.6 version of gradle. You need following upgrades too. Gradle Plugin Release page.

    1. Android Studio 3.+

    You need Android Studio version 3.+ to have 4.6 version of gradle. At the time of post latest release was 3.2.1. You can see latest release on this page.

    2. Gradle Plugin 3.1.+

    You need 3.1.+ gradle plugin for gradle-4.6 support. Check in project level build.gradle.

    classpath 'com.android.tools.build:gradle:3.2.1'
    

    At the time of post latest version was 3.2.1. You can see latest release here.

    3. Add Google Maven Library

    You need to add Google Maven library to project level build.gradle like below code.

    buildscript {
        repositories {
            google()
            ...
        }
        dependencies {
            classpath 'com.android.tools.build:gradle:3.2.1'
            ...
        }
    }
    
    allprojects {
        repositories {
            google()
            ...
        }
    }
    

提交回复
热议问题