我正在使用Android Studio 3.0.1。我更新了Android SDK和Android工具。我也搜索并尝试了其他人尝试过的各种解决方案,但没有一个起作用。
我该怎么办?
顶级构建gradle
buildscript {
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.0.1'
}
}
allprojects {
repositories {
google()
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
应用程序构建gradle文件
apply plugin: 'com.android.application'
android {
compileSdkVersion 26
defaultConfig {
applicationId "com.reminder"
minSdkVersion 14
targetSdkVersion 26
buildToolsVersion "26.0.2"
versionCode 1
versionName "1.0"
testInstrumentationRunner
"android.support.test.runner.AndroidJUnitRunner" }
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'),
'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
implementation 'com.android.support.constraint:constraint-layout:1.0.2'
implementation 'com.android.support:support-v4:26.1.0'
implementation 'com.android.support:design:26.1.0'
implementation 'com.android.support:appcompat-v7:26.1.0'
}
将以下行放在项目内的gradle.properties文件中:
systemProp.http.proxyHost=fodev.org
systemProp.http.proxyPort=8118
systemProp.https.proxyHost=fodev.org
systemProp.https.proxyPort=8118
并在以下文件中:
Windows: C:\Users\[username]\.gradle\gradle.properties
Linux: /home/[username]/.gradle/gradle.properties
最后再次同步您的项目。
注意:在此链接中,鸣谢归该帖子的作者。
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句