error: cannot find symbol class Android Studio

随声附和 提交于 2021-02-11 17:42:37

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!