I am getting a gradle build error in Android studio as below:
Error:A problem occurred configuring project ':MyApp'.
Could not resolve all dependencies for configuration ':MyApp:classpath'.
Could not resolve io.fabric.tools:gradle:1.+.
Required by:
sw-android:MyApp:unspecified
Failed to list versions for io.fabric.tools:gradle.
Unable to load Maven meta-data from
https://repo1.maven.org/maven2/io/fabric/tools/gradle/maven-metadata.xml.
Could not GET 'https://repo1.maven.org/maven2/io/fabric/tools/gradle/maven-metadata.xml'.
peer not authenticated
Failed to list versions for io.fabric.tools:gradle.
Unable to load Maven meta-data from
http://maven.fabric.io/public/io/fabric/tools/gradle/maven-metadata.xml.
Could not GET http://maven.fabric.io/public/io/fabric/tools/gradle/maven-metadata.xml'.
peer not authenticated
I found that "https" Tag is not working to download the Maven URL so I changed the https to http in my build.gradle file. Also I checked all the gradle settings and manually modify the other.xml file in the path C:\Users\Ashfaque1.AndroidStudio\config\options\ but still it is taking the https://repo1.maven.org/maven2/io/fabric/tools/gradle/maven-metadata.xml. Also once I am hitting this link to the browser I am getting the 404 exception but the 2nd URL in Error http://maven.fabric.io/public/io/fabric/tools/gradle/maven-metadata.xml, I am able to hit successfully and downloading the Metadata file correctly in my system. Not able to understand what is the problem, where I need to change the settings so that metadata file will be downloaded. Please suggest if I need to change any settings or from where it is taking this URL https://repo1.maven.org/maven2//io/fabric/tools/gradle/maven-metadata.xml
My build.gradle file is as below:
apply plugin: 'com.android.application'
apply plugin: 'io.fabric'
buildscript {
repositories {
mavenCentral()
maven { url 'http://maven.fabric.io/public' }
}
dependencies {
classpath 'com.android.tools.build:gradle:1.1.0'
classpath 'io.fabric.tools:gradle:1.+'
}
}
repositories {
mavenCentral()
maven { url 'http://maven.fabric.io/public' }
}
dependencies {
compile 'com.android.support:multidex:1.0.0'
compile fileTree(dir: 'libs',include: '*.jar')
compile project(':DeviceService')
compile project(':RatioCommon')
compile project(':SlidingMenu:library')
compile project(':SmartViewLibrary:SmartView')
compile project(':SmartViewLibrary:OpenAccess')
compile('com.crashlytics.sdk.android:crashlytics:2.2.0@aar') {
transitive = true;
}
}
compileSdkVersion 21
buildToolsVersion "21.1.2"
defaultConfig {
minSdkVersion 18
targetSdkVersion 21
// Enabling multidex support.
multiDexEnabled true
}
dexOptions {
javaMaxHeapSize "4g"
}
}