1

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

aduguid
  • 3,099
  • 6
  • 18
  • 37
  • I've been getting that error in the IDE for awhile now (only for my espresso test build though) since an upgrade, but the tests still build and work fine. Does your project still build and function? – Tyler V Jun 24 '18 at 16:04
  • Exactly, I can test my app on my phone but instead I have to generate the signed apk and I can't do that – Susanna Scalo Jun 24 '18 at 16:06
  • Do you think that passing to an older version of Android Studio can help? – Susanna Scalo Jun 24 '18 at 16:07
  • Got it. Since the error in mine is only in the `androidTestImplementation` line I haven't had to build a signed version of that. Hopefully someone posts a solution here, I think I've seen this question asked before without a solution – Tyler V Jun 24 '18 at 16:07

1 Answers1

0

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'
Tyler V
  • 9,694
  • 3
  • 26
  • 52