问题
This error hapens after update mac osx or system (I don't know).
It was after I open project that I closed one weak ago.
My settings.gradles is:
include ':app' , ':api', ':daogenerator'
project(':mobilneapi').projectDir = new File("/Users/AndroidstudioProjects/Modules/api")
project(':daogenerator').projectDir = new File("/Users/AndroidstudioProjects/Modules/daogenerator")
And my app gradle:
apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion "23.0.1"
defaultConfig {
applicationId "pl.wm.myapplication"
minSdkVersion 15
targetSdkVersion 23
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile project(':api')
compile project(':daogenerator')
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:23.0.1'
}
When I add import into MainActivity in Main Project. I have got error after compile:
Error:(6, 24) error: cannot find symbol class Cache
What was wrong?
The same error on gradle build tools 1.3.0 and 1.2.4
回答1:
try the usual stuff:
- rebuild/clean project.
- sync project with gradle files.
- force close studio64.exe and restart it
- restart the computer!
I hate these kind of errors, when nothing works, I usually end up creating a new project and start copying everything to it.
来源:https://stackoverflow.com/questions/33148063/error-cannot-find-symbol-class-android-studio