Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

failed to resolve com.android.support:appcompat-v7:22 and com.android.support:recyclerview-v7:21.1.2

I installed ALL Extra and SDK API 21-22 including changed

compileSdkVersion 22 to 21 and buildToolsVersion '22.0.1' to 21.1.2.

I'm having Rendering Problems for API 22. I have tried changing the version to <= 21 but I'm still getting an error.

like image 885
Dump Choenthanomwong Avatar asked Mar 26 '15 16:03

Dump Choenthanomwong


3 Answers

These are the correct version that you can add in your build.gradle according to the API needs.

API 24:

implementation 'com.android.support:appcompat-v7:24.2.1'
implementation 'com.android.support:recyclerview-v7:24.2.1'

API 25:

implementation 'com.android.support:appcompat-v7:25.4.0'
implementation 'com.android.support:recyclerview-v7:25.4.0'

API 26:

implementation 'com.android.support:appcompat-v7:26.1.0'
implementation 'com.android.support:recyclerview-v7:26.1.0'

API 27:

implementation 'com.android.support:appcompat-v7:27.1.1'
implementation 'com.android.support:recyclerview-v7:27.1.1'
like image 165
priyank Avatar answered Nov 12 '22 23:11

priyank


In order to make that working I had to set:

compile ("com.android.support:support-v4:22.2.0")
compile ("com.android.support:appcompat-v7:22.2.0")
compile ("com.android.support:support-annotations:22.2.0")
compile ("com.android.support:recyclerview-v7:22.2.0")
compile ("com.android.support:design:22.2.0")

compile ("com.android.support:design:22.2.0")

Documentation states something different (docs):

com.android.support:support-design:22.0.0

like image 25
fabiozo Avatar answered Nov 12 '22 22:11

fabiozo


Real path for Support Repository Libraries:

enter image description here

  1. You should download Support Repository Libraries.

If the problem still exists:

  1. Go to the real path of your Support Repository Libraries and check that the following folder exists:

    "ANDROID_SDK_DIRECTORY\extras\android\m2repository\com\android\support" 
    

    In that folder there are support libraries that can't be found. for example:

    "ANDROID_SDK_DIRECTORY\extras\android\m2repository\com\android\support\appcompat-v7"
    
  2. Open folder appcompat-v7 and you see folders with all available version. You should use only one of these versions in the build.gradle file dependencies or use +, for ex. 18.0.+

    dependencies {
        compile fileTree(dir: 'libs', include: ['*.jar'])
        compile 'com.android.support:appcompat-v7:18.0.+'
        compile 'com.android.support:gridlayout-v7:23.1.1'
        compile 'com.android.support:support-v4:23.1.1'
    }
    

That is the path taken from grade.build dependencies file:

com.android.support:appcompat-v7:18.0.0

Refer to the real path on your HDD -->

ANDROID_SDK_DIRECTORY\extras\android\m2repository\com\android\support\appcompat-v7\18.0.0

If there is no such folder, you will receive the error:

"failed to resolve com.android.support:appcompat-v7:18.0.0"  

p.s. If you have Windows x64, when installing sdk and jdk, make sure that the installation path does not have Program Files(86). Brackets that add Windows may cause additional problems with resolving paths for your project. Use simple paths for your installation folder.

For example:

c:\androidSDK\
like image 24
Sergey Orlov Avatar answered Nov 12 '22 23:11

Sergey Orlov