Hi everyone, I can’t add a cardview dependency in gradle. Recycler is added normally. And when synchronizing with cardview, it gives an error

Closed due to the fact that off-topic participants aleksandr barakin , Viktorov , post_zeew , cheops , Ainar-G 21 Dec '17 at 12:22 .

It seems that this question does not correspond to the subject of the site. Those who voted to close it indicated the following reason:

  • “Questions asking for help with debugging (“ why does this code not work? ”) Should include the desired behavior, a specific problem or error, and a minimum code for playing it right in the question . Questions without an explicit description of the problem are useless for other visitors. See How to create minimal, self-sufficient and reproducible example . " - aleksandr barakin, Viktorov, post_zeew, cheops, Ainar-G
If the question can be reformulated according to the rules set out in the certificate , edit it .

  • one
    And what a mistake. Can't match versions with appcompat - ruslan
  • write app @ debugUnitTest / compileClasspath: Could not resolve com.android.support:cardview-v7:26.1.0 ' -
  • dependencies {implementation fileTree (include: ['* .jar'], dir: 'libs') implementation' com.android.support:appcompat-v7:26.1.0 'implementation' com.android.support.constraint: constraint-layout : 1.0.2 'testImplementation' junit: junit: 4.12 'androidTestImplementation' com.android.support.test: runner: 1.0.1 'androidTestImplementation' com.android.support.test.espresso: espresso-core: 3.0.1 'implementation 'com.android.support:recyclerview-v7:26.1.0' implementation 'com.android.support:cardview-v7:26.1.0'} - lena
  • maybe it will help - Starting with version 26 of the support libraries, you should add to your dependency buildscript maven {url maven.google.com } - ruslan
  • but in more detail)) I don’t understand what exactly should be added - Lena

1 answer 1

It is necessary to turn off offline mode. File-> Settings-> Build, Execution, Deployment-> Gradle-> Uncheck Offline work option