Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

compile project dependencies with latest version of android support library

I was using 25 as targetSdkVersion,compileSdkVersion in my project. Then a warning showed up.

Not targeting the latest versions of Android; compatibility modes apply. Consider testing and updating this version. Consult the android.os.Build.VERSION_CODES javadoc for details.

So I raised it to 26. And I opened my SDK Manager and updated everything:

SDK Tools , SDK Platform-Tools , etc.

Then another warning showed up:

This support library should not use a lower version (25) than the targetSdkVersion (26)

I was using this version:

    compile 'com.android.support:appcompat-v7:25.3.1'

Now I don't know to which version exactly should I change to.

I tried 7:26.0.0 which my SDK Platform-Tools version is now.

I tried 7:26.0.2 which my SDK Tools version is now.

Both of them give me error after sync:

Failed to resolve: com.android.support.appcompat-v7:26.0.2

Install repository and sync project

Then if I click on Install nothing will happen

Now I have a simple question. How can I find out what is the latest version of support library?

like image 734
Mehran Avatar asked Jun 12 '17 17:06

Mehran


2 Answers

Then another warning showed up:

This support library should not use a lower version (25) than the targetSdkVersion (26)

Now I don't know to wich version exactly should I change to.

Either one as you simply should have version match here, so either lower your targetSdkVersion to 25 or use valid version for 26+ libs.

Error:(29, 13) Failed to resolve: com.android.support:cardview-v7:26.0.0 Install Repository and sync project

26 is not officially out yet so just RCs or betas, therefore valid version string is i.e. 26.0.0-beta1.

Finally, you should check if your repository includes new google maven repo, otherwise some artefacts will not be available for your project incl. recent betas of support libs.

See docs for details of setting it all up.

like image 198
Marcin Orlowski Avatar answered Oct 26 '22 23:10

Marcin Orlowski


Add maven repository to your project gradle file:

allprojects {
repositories {
    jcenter()
    maven {
        url "https://maven.google.com"
    }
  }
}
like image 39
Celt K. B. Avatar answered Oct 26 '22 22:10

Celt K. B.