Reputation: 185
I'll start off by saying that I am aware that this is a somewhat known bug brought up on StackOverflow before, but the solutions offered seem to be temporary for me, or only work sometimes.
See: Cannot resolve symbol 'AppCompatActivity' and Can't resolve AppCompatActivity...
Fixes suggest by these threads offered me temporary fixes that seem to be undone the moment I clean the project before pushing to Github (for the Udacity Nanodegree program).
Has there been a fix that I just can't seem to find online? Again, keep in mind, changing the version to xx.x.+, syncing, xx.x.x, sync again, only seems to work temporarily. Same with Invalidating the caches and restarting. The error returns upon a project/gradle clean.
****Update: This is what my build.gradle looks like:
apply plugin: 'com.android.application'
android {
compileSdkVersion 24
buildToolsVersion "24.0.1"
defaultConfig {
applicationId "com.example.frank.myappportfolio"
minSdkVersion 15
targetSdkVersion 24
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:24.1.1'
}
**** Update: It seems that when I do a Gradle Clean the error comes up but when I Rebuild the project completely the error goes away. Any idea why?
Upvotes: 0
Views: 167
Reputation: 901
I have tried clean & Invalidate Cache but couldn't solve the issue.
Problem solved after:
Upvotes: 0
Reputation: 8705
After updating Android studio to version 2.3
I've updated appcompat library from version 25.0.1 to 25.1.0
In gradle:
com.android.support:appcompat-v7:25.0.1 (old)
com.android.support:appcompat-v7:25.1.0 (new)
Everything works well now
Upvotes: 1
Reputation:
Try to clean the android studio's cache, go to the File->Invalidate Caches/Restart
Upvotes: 1