mixing versions can lead to runtime crashes, no solution work

44 Views Asked by At

I've recently updated my Android Studio to 3.1.3 version and something happened: when I start a new project a lot of commands like "findViewById" and so on do not work, but that's not my real problem. I found an old project after years and I wish to work on it, on this project Android Studio recognize all the commands but when it says that I am using different types of versions in my Gradle. I looked for a solution everywhere, I tried downloading all the platforms and using newer platforms but then some commands do not get recognized and anyway the same problem persisted. I don't know what to do, have you got a solution please? thanks

screenshot

screenshot

1

There are 1 best solutions below

0
On

I was able to figure this out eventually!

My error message said something was including version 26.1.0 (older than my target). I went to the Terminal tab on the bottom bar in Android Studio and ran gradlew app:dependencies > out which dumped a lot of info to out (in my project directory).

Open out, search for the conflict (in my case 26.1.0) and I found this:

+--- com.google.android.gms:play-services-ads:15.0.1
|    +--- com.android.support:customtabs:26.1.0
|    |    +--- com.android.support:support-compat:26.1.0 -> 27.1.1
|    |    |    +--- com.android.support:support-annotations:27.1.1
|    |    |    \--- android.arch.lifecycle:runtime:1.1.0
|    |    |         +--- android.arch.lifecycle:common:1.1.0
|    |    |         \--- android.arch.core:common:1.1.0

Now that I know what the problem is, I used the solution here to fix it, which was to add the newer version with

implementation 'com.android.support:customtabs:27.1.1'