找不到 aapt2-proto.jar [英] Could not find aapt2-proto.jar

查看:59
本文介绍了找不到 aapt2-proto.jar的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

请参阅此链接(如我怀疑)有 POM 文件但没有 jar.

See this link (as I suspected) has the POM file and no jar.

重要说明:

  • 我正在使用 最新 版本的 react native ... v0.57.3 以及最新版本的 react-native-cli ... v2.0.1 此时.
  • 我的计算机上安装了 Java 11.
  • 我目前正在使用 最新 gradle 版本... v4.10.2
  • 我使用的是 Mac OSX Mojave
  • I am using latest version of react native ... v0.57.3 and also latest version of react-native-cli ... v2.0.1 at this time.
  • I have Java 11 installed in my computer.
  • I am using latest gradle release at this time ... v4.10.2
  • I am using Mac OSX Mojave

分发网址为:

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

推荐答案

Google 的 maven 存储库中似乎提供了 AAPT2(Android Asset Packaging Tool 2).

It seems like AAPT2(Android Asset Packaging Tool 2) is available in Google's maven repository.

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

You need to include google() under repositories in build.gradle file as shown:

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

看看这个链接更详细.

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

Note: Order also matters, if jcenter() is above google() it fails.

这篇关于找不到 aapt2-proto.jar的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆