问题
My firewall is not letting me access the the gradle . is there a way around this?
FAILURE: Build failed with an exception.
- What went wrong:
A problem occurred configuring root project 'MyApplication3'.
Could not resolve all dependencies for configuration ':classpath'. Could not resolve com.android.tools.build:gradle:1.5.0. Required by: :MyApplication3:unspecified Could not resolve com.android.tools.build:gradle:1.5.0. Could not get resource 'https://jcenter.bintray.com/com/android/tools/build/gradle/1.5.0/gradle-1.5.0.pom'. Connection to https://jcenter.bintray.com refused
here is my gradle file
apply plugin: 'com.android.application'
final def extension = android {
compileSdkVersion 23
buildToolsVersion "23.0.3"
defaultConfig {
applicationId "com.tataelxsi.snigdha.myapplication"
minSdkVersion 8
targetSdkVersion 23
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguardandroid.txt'), 'proguard-rules.pro'
}
}
}
extension
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
compile 'com.android.support:appcompat-v7:23.2.1'
compile 'com.android.support:support-v4:23.2.1'
compile 'com.android.support:design:23.2.1'
}
android {
compileSdkVersion 23
buildToolsVersion '23.0.3'
}
回答1:
You just open your root gradle file and then set your class path in dependencies block like this but be sure that class path set in your project gradle file not in your modual gradle file i hope this will help you
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:1.5.0'
}
}
allprojects {
repositories {
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
回答2:
- go to control panel
- choose system and security
- you will see windows firewall option choose
- allow a program through windows firewall
image here
now uncheck the android studio and click ok
来源:https://stackoverflow.com/questions/36614510/android-studio-build-error-firewall-blocking-gradle-access-to-studio