Could not find aapt2-proto-0.3.1.jar (com.android.tools.build:aapt2-proto:0.3.1)(红包🧧答谢)?
我在RN项目的android目录下执行了./gradlew clean命令进行清理,但是报了如下的错误:
- What went wrong:A problem occurred configuring project ':react-native-baidu-map'.Could not resolve all files for configuration ':react-native-baidu-map:classpath'.Could not find aapt2-proto-0.3.1.jar (com.android.tools.build:aapt2-proto:0.3.1).
Searched in the following locations:
https://maven.aliyun.com/repository/gradle-plugin/com/android/tools/build/aapt2-proto/0.3.1/aapt2-proto-0.3.1
我已经按照网上的解决办法把google()方法置顶了,但是依旧不行。这是我的配置文件:
def safeExtGet(prop, fallback) {
rootProject.ext.has(prop) ? rootProject.ext.get(prop) : fallback
}
apply plugin: 'com.android.library'
buildscript {
repositories {
google()
mavenLocal()
mavenCentral()
jcenter()
maven() {
allowInsecureProtocol true
url 'http://repo.lovebing.net/repository/maven-public/'
}
maven() { url 'https://maven.aliyun.com/repository/gradle-plugin/' }
}
dependencies {
classpath 'com.android.tools.build:gradle:3.3.0'
}
}
repositories {
google()
mavenLocal()
mavenCentral()
jcenter()
maven {
allowInsecureProtocol true
url 'http://repo.lovebing.net/repository/maven-public/'
}
maven {
url 'https://maven.aliyun.com/repository/gradle-plugin/'
}
}
android {
compileSdkVersion safeExtGet('compileSdkVersion', 28)
buildToolsVersion safeExtGet('buildToolsVersion', '28.0.3')
defaultConfig {
minSdkVersion safeExtGet('minSdkVersion', 21)
targetSdkVersion safeExtGet('targetSdkVersion', 28)
versionCode 1
versionName "${version}"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
}
dependencies {
compileOnly 'com.facebook.react:react-native:0.62.2'
implementation files('libs/BaiduLBS_Android.jar')
compileOnly files('src/main/assets')
}
请问各位大神,还有什么别的解决办法吗?着急中...如果您所提供的解决方案有效,我愿意奉上一个红包作为答谢。
回复
1个回答
适合作为回答的
- 经过验证的有效解决办法
- 自己的经验指引,对解决问题有帮助
- 遵循 Markdown 语法排版,代码语义正确
不该作为回答的
- 询问内容细节或回复楼层
- 与题目无关的内容
- “赞”“顶”“同问”“看手册”“解决了没”等毫无意义的内容