首页 > 解决方案 > 找不到 aapt2-proto.jar

问题描述

看到这个链接(我怀疑)有 POM 文件,没有 jar。

重要笔记:

分发网址是:

distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.2-all.zip

这是错误

FAILURE: Build failed with an exception.

* What went wrong:
A problem occurred configuring root project 'AwesomePlacesApp'.
> Could not resolve all artifacts for configuration ':classpath'.
   > Could not find aapt2-proto.jar (com.android.tools.build:aapt2-proto:0.3.1).
     Searched in the following locations:
         https://jcenter.bintray.com/com/android/tools/build/aapt2-proto/0.3.1/aapt2-proto-0.3.1.jar

标签: androidandroid-studioreact-nativejcenteraapt2

解决方案


Google 的 maven 存储库中似乎提供了 AAPT2(Android 资产打包工具 2)。

您需要在 build.gradle 文件的存储库下包含google() ,如下所示:

buildscript {
  repositories {
      google() // here
      jcenter()
  }
  dependencies {
      classpath 'com.android.tools.build:gradle:3.2.0-alpha12'
  }
} 
allprojects {
  repositories {
      google() // and here
      jcenter()
}

请查看此链接以获取更多详细信息。

注意:顺序也很重要,如果 jcenter() 高于 google() 它会失败。


推荐阅读