2

I work with android studio and in build.gradle file some dependencies are underlined in red. The message is :

This support library should not use a different version (25) than the compileSdkVersion (26)

I know how to resolve this (just use the same version) but my question is : what will happen if I leave it that way ? Will I have problems knowing that my config is :

  • targetSdkVersion 26
  • compileSdkVersion 26

Thank you for your answer and have a nice day :)

Seb
  • 23
  • 1
  • 6
  • Thank you for your answer Onik ! But I did the build with this in my dependencies : compile 'com.android.support:cardview-v7:25.3.1' – Seb Sep 21 '18 at 11:51

1 Answers1

0

Your app may run fine. Or it may crash. In short, mismatching support library and compile versions may/will lead to undefined behavior.

scottt
  • 7,931
  • 1
  • 28
  • 39
  • Thank you scottt ! But if the application is well tested, is it still possible that the application crash (caused by versions mismatching) ? – Seb Sep 21 '18 at 12:07
  • 1
    You should always match the support libraries to the compiled SDK, there's no reason why shouldn't want to anyway. Its very possible, that an older support library running on a higher targetted SDK could cause a crash in some unexpected way under certain circumstances – Boardy Sep 21 '18 at 12:39
  • Thank's, I understand. I ask this question because we use RoboGuice in our app and it is not supported anymore. If I change the support library version from 25 to 26 I have a lot of compilation errors. That why I try to find an alternative but in fact, I have no choice. – Seb Sep 21 '18 at 12:53
  • It may be better for you to lower your compile and target SDKs down to 25 so that you can keep everything in sync. – scottt Sep 21 '18 at 21:08