android - 找不到 aapt2-proto.jar
问题描述
看到这个链接(我怀疑)有 POM 文件,没有 jar。
重要笔记:
- 我正在使用最新版本的 react native ... v0.57.3 以及最新版本的 react-native-cli ... v2.0.1。
- 我的计算机中安装了 Java 11。
- 我此时正在使用最新的 gradle 版本... v4.10.2
- 我正在使用 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)。
您需要在 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() 它会失败。
推荐阅读
- microsoft-graph-api - 如何区分 M365 中的 MailUser 和 Cloud User?
- android - Koin 错误:org.koin.core.error.NoBeanDefFoundException。如何解决问题?
- reactjs - 如何使 api 响应与 React JS 中的先前结果不同
- android - 无效的 depfile:kernel_snapshot.d
- linux - 重启后网络无法访问
- ios - swift - 更改注释视图按钮
- scripting - 我们可以在 Servicenow 平台中使用脚本创建自定义选择字段吗?
- node.js - 使用 sequelize cli 时,错误“在表“角色”上插入或更新违反了外键约束“Role_created_by_User_fk”
- python - C 支持 scipy 吗?或者我们如何在 pycuda 中使用 scipy
- django - 在 Django Admin 中无法删除 — 对象将 ITSELF 称为受保护对象