gpt4 book ai didi

android - Gradle 错误 : unable to open zip file

转载 作者:塔克拉玛干 更新时间:2023-11-02 22:51:50 24 4
gpt4 key购买 nike

当我打开 Project 时会报错:

Error:Failed to open zip file. Gradle's dependency cache may be corrupt (this sometimes occurs after a network connection timeout.) Re-download dependencies and sync project (requires network)

我试过这个: Error:Failed to open zip file. Gradle dependency cache may be corrupt (this sometimes occurs after a network connection timeout.)

但不适合我。

这是我的build.gradle 文件:

apply plugin: 'com.android.application'

android {
compileSdkVersion 26
buildToolsVersion "26.0.2"
defaultConfig {
applicationId "com.example.web"
minSdkVersion 18
targetSdkVersion 26
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
productFlavors {
}
}

dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:26.0.1'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
}
allprojects {
repositories {
jcenter()
maven {
url 'https://maven.google.com'
}
maven { url "https://jitpack.io" }

}

顶级构建文件(项目级)

// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.3.3'

// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}

allprojects {
repositories {
jcenter()

flatDir {
dirs "${rootDir}/libs"
}
}

}

task clean(type: Delete) {
delete rootProject.buildDir
}

最佳答案

我前段时间也遇到过同样的问题,我找到了简单的解决方法。

File ->Invalidate Caches/ Restart -> Select Invalidate and Restart option.

它将清除所有本地历史记录并自动重启。所有必要的文件将自动下载。

关于android - Gradle 错误 : unable to open zip file,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42805180/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com