Could not find aapt2-proto.jar (com.android.tools.build:aapt2-proto:0.3.1)

前端 未结 2 754
不思量自难忘°
不思量自难忘° 2020-12-21 12:36

I\'m using Android Studio to work with tomahawk-android project, so i cloned the project using git, directly into the Android Studio,

2条回答
  •  有刺的猬
    2020-12-21 13:11

    This is due you didn’t put google() as the first repo. The order of google() matters. So just add it above jcenter() will solve your problem.

    See https://stackoverflow.com/a/51151050/8034839

    Note that this change should be in your TOP level build.gradle file. E.g.

    // Top-level build file where you can add configuration options common to all sub-projects/modules.
    
    buildscript {
    
        repositories {
            google() // first one
            jcenter()
        }
        dependencies {
            classpath 'com.android.tools.build:gradle:3.2.1'
    
    
            // NOTE: Do not place your application dependencies here; they belong
            // in the individual module build.gradle files
        }
    }
    
    allprojects {
        repositories {
            google() // first one
            jcenter()
        }
    }
    

    Note:

    Since Android Gradle Plugin (AGP) version 3.0.0 (Gradle version 4.1+), Google introduced its own Google's Maven repository google(), most of the dependencies were moved to there. So, if you are using the AGP 3.0+, you should refer to this NEW repo firstly.

    And here is some explanation about different gradle versions: What is real Android Studio Gradle Version?

提交回复
热议问题