Closed marcio-b closed 4 years ago
Can you please specify which class or method is displaying "cannot resolve symbol".
thanks for your response @Mayur1496. I am getting this errors on the import statement itself.
When i position the caret above the red lines, the "cannot resolve symbol" error appears.
Make sure that you have this dependency in your build.gradle file under dependecies:
compile 'com.android.support:appcompat-v7:26.0.0-alpha1'
This is the current latest version of support library. So you might get an error if you are not using compileSdkVersion 26.
This is how my whole build.gradle file looks like:
apply plugin: 'com.android.application'
android {
compileSdkVersion 26
buildToolsVersion '26.0.1'
defaultConfig {
applicationId "com.example.android.pets"
minSdkVersion 15
targetSdkVersion 26
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile 'com.android.support:appcompat-v7:26.0.0-alpha1'
compile 'com.android.support:design:26.0.0-alpha1'
}
I'm really really sorry for so much time with no answer, my carreer took me in another direction and I was not able to continue with this. I'm sure this is already very outdated and maybe obsolete. So I'm sugesting to close this issue. I want to thank everyone who took time to reply and apologize again for the delay.
getSupportLoaderManager
instead of getLoaderManager() solves the issue, don't worry even if it says it's deprecated. It just works.
I have the same imports that the ones showed here but in the lesson it says that i should have imported
import android.support.v7.app.LoaderManager; import android.support.v7.content.CursorLoader; import android.support.v7.content.Loader; import android.support.v7.widget.SimpleCursorAdapter;
but when i do, i get the "cannot resolve symbol " error.I think i should compile something in the gradle files, but i'm not sure, and also I don't know how exactly. Would anyone help me with this?
Thanks in advance.