Lea*_*ays 5 android gradle android-studio
当我打开Project时会出错:
错误:无法打开zip文件.Gradle的依赖缓存可能已损坏(这有时会在网络连接超时后发生.)重新下载依赖项并同步项目(需要网络)
我试过这个: 错误:无法打开zip文件.Gradle依赖性缓存可能已损坏(这有时会在网络连接超时后发生.)
但不适合我.
这是我的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" }
}
Run Code Online (Sandbox Code Playgroud)
顶级构建文件(项目级别)
// 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
}
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
3648 次 |
| 最近记录: |