如何解决Android 构建错误:无法获取 'https://dl.google.com/dl/android/maven2/com/android/tools/build/aapt2/4.0.2-6197926/aapt2-4.0.2-6197926-osx罐子'
一周以来我面临着多个问题。 这是当前的错误:无法获取'https://dl.google.com/dl/android/maven2/com/android/tools/build/aapt2/4.0.2-6197926/aapt2-4.0.2-6197926- osx.jar'。从服务器收到状态代码 405:方法不允许 启用 Gradle 的“离线模式”并同步项目
我使用的是 Android Studio 4.0.2 版,并且启用/禁用了离线模式。
这些是我的成绩文件:
build.gradle(module: app)
apply plugin: 'com.android.application'
android {
compileSdkVersion 29
buildToolsVersion "29.0.3"
defaultConfig {
applicationId "com.example.fithubapptrialnew"
minSdkVersion 16
targetSdkVersion 29
versionCode 1
versionName "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'),'proguard-rules.pro'
}
}
}
dependencies {
}
build.gradle(项目)
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
google()
jcenter()
maven {
url 'https://maven.google.com/'
}
}
dependencies {
classpath 'com.android.tools.build:gradle:4.0.2'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
mavenLocal()
google()
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
我尝试过使缓存无效/重启、清理项目和重建
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。