So I installed android studio 3.0.1 and as soon as it opened the gradle built and showed the following errors. I tried adding dependencies such as design and support but in
try to change the compileSdkVersion to: compileSdkVersion 28
in my case, I try tried File
>Invalidate Cache/Restart
and that works for me.
buildscript {
project.ext {
supportLibVersion = '27.1.1'
compileVersion = 28
minSupportedVersion = 22
}
}
and set dependencies:
implementation "com.android.support:appcompat-v7:$project.supportLibVersion"
Had the same issue while working on an application with several modules, check to make sure as you increase the compileSdkVersion
and targetSdkVersion
to 28+ values in a module you also do for the others.
A module was running on compileSdkVersion 29
and targetSdkVersion 29
while a second module of the application was running on compileSdkVersion 27
and targetSdkVersion 27
.
Changing the second module to also compile for and target SDK version 29 resolved my issue. Hope this helps someone.
I was having the same issue while adding a mapbox navigation API and resolved this issue by going to: file>project Structure and then setting the compile sdk version and build tool version to the latest. And here is the screenshot:
Hope it helps.
The dependencies must be applied as shown below to solve this issue :
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation 'com.android.support.constraint:constraint-layout:1.0.2'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.1'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1'
implementation 'com.android.support:support-v4:27.1.0'
implementation 'com.android.support:appcompat-v7:27.1.0'
implementation 'com.android.support:recyclerview-v7:27.1.0'
}
Please do not use the version of :
v7:28.0.0-alpha1