我最近将我的 Android Studio 更新到 3.1.3 版本并且发生了一些事情:当我开始一个新项目时,很多命令,如“findViewById”等都不起作用,但这不是我真正的问题。多年后我找到了一个旧项目,我希望继续努力,在这个项目上,Android Studio 可以识别所有命令,但是当它说我在我的 Gradle 中使用不同类型的版本时。我到处寻找解决方案,我尝试下载所有平台并使用更新的平台,但是有些命令无法被识别,无论如何同样的问题仍然存在。不知道怎么办,请问有解决办法吗?谢谢
问问题
28 次
1 回答
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'
于 2018-06-24T16:22:16.417 回答