Created a new project to try to work with the library. support:design added

 compile 'com.android.support:design:22.2.0' 

depending and it worked.

I decided to add the same thing to the main project and showed me a mistake, I looked and understood that the problem is that the version

 compileSdkVersion 23 

higher than the library

 compile 'com.android.support:design:22.2.0' 

i looked my

 buildToolsVersion "23.0.2" 

and decided to put the version of the library too, and it began to look like this

 compile 'com.android.support:design:23.0.2' 

This is how my build looks like

 buildscript { repositories { jcenter() } dependencies { classpath 'com.android.tools.build:gradle:2.1.0' } } apply plugin: 'com.android.application' repositories { jcenter() } dependencies { compile 'com.android.support:design:23.3.0' compile 'com.android.support:appcompat-v7:24.0.0-alpha2' compile 'com.facebook.android:facebook-android-sdk:4.0.0' compile 'com.google.android.gms:play-services:6.5.87' compile 'com.android.support:cardview-v7:23.3.0' compile files('libs/svgandroid.jar') compile 'com.github.bumptech.glide:glide:3.5.2' compile files('libs/guava-16.0.1.jar') compile 'com.google.code.gson:gson:2.6.1' } // The sample build uses multiple directories to // keep boilerplate and common code separate from // the main sample code. List<String> dirs = [ 'main', // main sample code; look here for the interesting stuff. 'common', // components that are reused by multiple samples 'template'] // boilerplate code that is generated by the sample template process android { compileSdkVersion 23 buildToolsVersion "23.0.2" repositories { mavenCentral() } defaultConfig { minSdkVersion 21 targetSdkVersion 21 } compileOptions { sourceCompatibility JavaVersion.VERSION_1_7 targetCompatibility JavaVersion.VERSION_1_7 } sourceSets { main { dirs.each { dir -> java.srcDirs "src/${dir}/java" res.srcDirs "src/${dir}/res" } } androidTest.setRoot('tests') androidTest.java.srcDirs = ['tests/src'] } } 

build will get this window

window 1

Naturally clicked Install Repository and syns and got this window

window 2

It seems like the Internet is not enough, although the Internet works fine.

I tried to change the version of this library for different and different errors each time ...

What needs to be done to make it work?

I tried different versions, that's what happens when I connect

 'com.android.support:design:23.3.0' 

What resources are already identified and shows an error .. What does this mean?

window 3

  • 2
    What makes you think that library version 23.0.2 exists? Stop tying the build tools version to the library version, they are completely independent of each other. - Vladyslav Matviienko
  • @metalurgus I thought so)) - Aleksey Timoshchenko
  • @metalurgus He just noticed that after adding this library, the project starts to highlight the R class in red ... Why does the project stop seeing it ... If I remove the library, everything starts working ... - Aleksey Timoshchenko

2 answers 2

There was no version 23.0.2 in the Google Support Library , so you get an error.

You can get acquainted with the version numbers of the released support libraries, for example, here .

And it is better to add dependencies through the master (option # 1 of this answer ), rather than manually. He will not let you do such a thing.

  • Yes, I tried to find this wizard, but now the interface has changed and there is no tab to add dependency ... When I click on + it offers a lot of things, but there is also no add dependence ... When I click add library, android, it just creates a new library and asks call her name - Aleksey Timoshchenko
  • Just that I noticed that in the project after adding this library, the R class starts to highlight in red ... Why then the project stops seeing it ... If I tidy up the library, then everything starts working ... - Aleksey Timoshchenko
  • So that’s not the point ... ( - Aleksey Timoshchenko
  • @AlekseyTimoshchenko I don’t know where you tried to find out what interfaces you have changed, but I assure you that on the latest version of AS 2.1 all Project Structure wizards remained as they were. - pavlofff
  • Following the example, I click File - Project Structure and this is what I have opened dropmefiles.com/aSM28 . Maybe the interface is really changed for me ... - Aleksey Timoshchenko

Specify

 compile 'com.android.support:design:23.3.0' 

at least the design version is the same as the other versions from com.android.support

 dependencies { compile 'com.android.support:design:23.3.0' compile 'com.android.support:appcompat-v7:23.3.0' compile 'com.android.support:support-v4:23.3.0' } 

UPD update also

 defaultConfig { minSdkVersion 21 // укажите акутальную старую API которую будете поддерживать targetSdkVersion 23 } 

and all other libraries com.android.support indicate version 23.3.0

  • I added a description ... I tried to install different versions and always something fell out ... and now, too ... How to be? - Aleksey Timoshchenko
  • Just that I noticed that in the project after adding this library, the R class starts to highlight in red ... Why then the project stops seeing it ... If I tidy up the library, then everything starts working ... - Aleksey Timoshchenko
  • When you synchronize gradle, the build folder is deleted, so you have a backlight - Chaynik
  • So minSdkVersion 21 is correct ... The application will not work in versions below Lolipop - Aleksey Timoshchenko
  • As for R, I understood ... Until the hail does not finish executing the folder is not created ... And since there was an error with the hail, it still remains not created ... Right? - Aleksey Timoshchenko