0

Android beginner here...

I'm getting all sort of rendering errors, and eventually concluded it's got something to do with my gradle dependencies.

Now I found a nice tutorial which I've been following, http://www.android4devs.com/2015/06/navigation-view-material-design-support.html but I'm running to a problem extending it further, and there is something I don't think I understand.

Should I not be using the latest stable version of any library I can? Surely these libraries are backwards compatible?

If I am supposed to use the older version of library, to match the compile sdk (which I understand to mean I'm compiling for backwards compatibility, and supporting, say, lollipop API 21-22) then:

  1. I would need a place to see a complete list of all versions of all libraries (which I cannot find), and
  2. I would not be able to use new features like RecyclerView which only came in at Marshmallow API 23.

Am I missing something?

build.gradle (module app)

apply plugin: 'com.android.application'

android {
    compileSdkVersion 22
    buildToolsVersion '25.0.0'

    defaultConfig {
        applicationId "com.example.myFirstApp"
        minSdkVersion 15
        targetSdkVersion 22
        versionCode 1
...
...

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    compile 'com.android.support:appcompat-v7:26.1.0'
    compile 'com.android.support:design:26.1.0'
    compile 'de.hdodenhof:circleimageview:1.3.0'
    compile 'com.intuit.sdp:sdp-android:1.0.3'
    compile 'com.android.support:cardview-v7:26.1.0'
    compile 'com.android.support:recyclerview-v7:26.1.0'

Error message

The support library should not use a different version (26) than the compile sdk version (22).

OneCricketeer
  • 179,855
  • 19
  • 132
  • 245
Maxcot
  • 1,513
  • 3
  • 23
  • 51
  • Regarding CircleView, `1.3.0` is outdated itself. https://github.com/hdodenhof/CircleImageView... Just search the library, and you should find the versions – OneCricketeer Oct 22 '17 at 08:52

1 Answers1

1

You are using

compileSdkVersion 22

and

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

error you are getting is because you are using compat version 26 while compileSdkversion is 22

You should update to compileSdkVersion to 26 and android studio will download required files so that your error will be removed. If you cannot update your compilesdk version to 26. Then change support library version to 22.2.1

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

Got list of support libraries from link

https://developer.android.com/topic/libraries/support-library/rev-archive.html

and

https://developer.android.com/topic/libraries/support-library/revisions.html

Amod Gokhale
  • 2,346
  • 4
  • 17
  • 32
  • Does that not then mean that the app can only run on the later versions of android? – Maxcot Oct 22 '17 at 09:03
  • no. in your case minimum sdk version is 15. App will run above api level 15. Refer to this link https://developer.android.com/studio/publish/versioning.html for more information – Amod Gokhale Oct 22 '17 at 09:07