When I try to create a project in Android Studio, I get these errors.

screenshot of errors

Windows 7x64 system. Actually the question is where to dig and in what direction. Thank you in advance!

UPDATE - gradle build.gradle file:

// 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.2.3' // NOTE: Do not place your application dependencies here; they belong // in the individual module build.gradle files } } allprojects { repositories { jcenter() } } task clean(type: Delete) { delete rootProject.buildDir } 

and one more:

 apply plugin: 'com.android.application' android { compileSdkVersion 25 buildToolsVersion "25.0.2" defaultConfig { applicationId "ivybank.plesser_os.headfirstandroid" minSdkVersion 19 targetSdkVersion 25 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(dir: 'libs', include: ['*.jar']) androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', { exclude group: 'com.android.support', module: 'support-annotations' }) compile 'com.android.support:appcompat-v7:25.1.0' testCompile 'junit:junit:4.12' } 
  • Show the gradle files - Yuriyi SPb
  • @YuriSPb updated the question - plesser
  • Are you sure that you need all these test pieces? - Yuriy SPb
  • @ YuriySPb, to be honest, I don’t know, since the studio itself inserts it there (there are no such problems at home, at work I put it here and I ran into it) - plesser
  • one
    Well, if you don’t know what it means, you don’t need to) Just remove the dependencies with the tests - testCompile 'junit:junit:4.12' and androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', { exclude group: 'com.android.support', module: 'support-annotations' }) and testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" - YuriSPb

2 answers 2

The studio (more precisely gradle) cannot connect dependencies for some reason. In this case, for automated testing. They are included by default in the studio's default project.

If you do not need these tests, then you can simply remove them - testCompile 'junit:junit:4.12' and androidTestCompile('com.android.support.test.espresso:espres‌​so-core:2.2.2', { exclude group: 'com.android.support', module: 'support-annotations' }) and testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"

    Once everything is loaded from home normally, but not at work, then most likely at work the Internet goes through a proxy. To work correctly, find out the settings for the proxy, then create the gradle.properties file in the global gradle folder (as a rule, it is located in the user folder and is called .gradle and add the settings to it like this:

     systemProp.https.proxyPort=порт systemProp.https.proxyHost=хост 

    After that, all settings on this machine will not explicitly apply these settings.

    • This is all done. He cursed before that, but we looked at the logs of the proxy and the android studio and gave permission to the required addresses. The last log that we shot (before I wrote here) was without errors about connection failed - plesser
    • By the way for the retrofit, I opened a proxy, he got up. - plesser