0

I researched similar questions but none of the answers solved my problem. When I try to build the starter code for a coding assignment I get the following error:

Error: Cause: Peer not authenticated

My gradle files are the following:

// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
  repositories {
    jcenter()
    mavenCentral()
  }
  dependencies {
    classpath 'com.neenbedankt.gradle.plugins:android-apt:1.2'
    classpath 'com.google.gms:google-services:1.4.0-beta3'


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

allprojects {
  repositories {
    jcenter()
  }
}



apply plugin: 'com.android.application'
apply plugin: 'android-apt'

android {
  compileSdkVersion 23
  buildToolsVersion "23.0.1"

  defaultConfig {
    applicationId "com.example.sam_chordas.stockhawk"
    minSdkVersion 15
    targetSdkVersion 23
    versionCode 1
    versionName "1.0"
  }
  buildTypes {
    release {
      minifyEnabled false
      proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
    }
  }
}

repositories {
  maven { url "https://jitpack.io" }
}

dependencies {

  compile 'com.google.android.gms:play-services-gcm:8.4.0'
  compile 'com.squareup.okhttp:okhttp:2.5.0'
  apt 'net.simonvt.schematic:schematic-compiler:0.6.3'
  compile 'net.simonvt.schematic:schematic:0.6.3'
  compile 'com.melnykov:floatingactionbutton:1.2.0'
  compile 'com.android.support:design:23.1.1'
  compile('com.github.afollestad.material-dialogs:core:0.8.5.7@aar') {
    transitive = true
  }
}

I didn't manage any of those files as I don't have gradle experience yet.

Could you help me to figure out what went wrong?

Thank you very much.

P.S.:

The log files give me this error:

2016-03-23 13:01:29,664 [3912009]   INFO - .BaseProjectImportErrorHandler - Failed to import Gradle project at '/home/madelenko/Desktop/Stock-Hawk master' 
org.gradle.tooling.BuildException: Could not run build action using Gradle distribution 'https://services.gradle.org/distributions/gradle-2.4-all.zip'.

Followed by a gigantic traceback.

  • 1
    Can you post a log of the error? – OJ7 Mar 23 '16 at 15:27
  • I added the actual error. I hope it helps you to figure out what the problem is. Thank you very much. – Javier Ventajas Hernández Mar 23 '16 at 15:34
  • Did you update Android Studio recently? It seems to be a fairly common problem, try the [solution here](http://stackoverflow.com/questions/21066598/android-studio-0-4-2-gradle-project-sync-failed-error) and see if that works. – OJ7 Mar 23 '16 at 15:39
  • Also I noticed you do not have a gradle plugin under your dependencies. Try adding `classpath 'com.android.tools.build:gradle:1.5.0'` under `buildscript { ... dependencies { } }` – OJ7 Mar 23 '16 at 15:45
  • Adding the classpath didn't do the trick, let me try the solution you posted and I'll let you know ASAP. Thanks again. – Javier Ventajas Hernández Mar 23 '16 at 15:49
  • Unfortunately, the solution didn't work. It downloaded the gradle folder again but gave me the same error. Any other possible solutions that you know? – Javier Ventajas Hernández Mar 23 '16 at 15:57
  • Hmm so think I misread the post. Which file is the above code in? There are multiple build.gradle files. One in the root directory of the application and another in the app folder. Please update to show both file contents. – OJ7 Mar 23 '16 at 16:19

0 Answers0