本文介绍了找不到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资产打包工具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的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!