I open the project (opensource) to see the implementation. Everything seems to be fine, but swears in R:
@Override
protected void onFinishInflate () {
super.onFinishInflate ();
mTitle = (TextView) findViewById (R.id.title);
mAuthor = (TextView) findViewById (R.id.author);
mPubDate = (TextView) findViewById (R.id.pub_date);
}
What does this mean and what are the ways to solve this problem?
Answer 1, authority 100%
In AndroidStudio File- & gt; InvalidateCahces
. You can also Build- & gt; Clean Project
.
Update
If you open a project taken, for example, from GitHub, and change, for example, the package name, then the data on the classpaths that are stored in the cache are correspondingly different. When you clear the cache, the system picks up the changes.
Answer 2, authority 14%
You can also click Sync Project with Gradle files
. Helped me.
Answer 3
This helped me: set the Compile Sdk Version to the latest.
http://dominoc925.blogspot.com/2014/ 11 / fixing-android-studio-cannot-resolve.html
Answer 4
I was helped by changing the compileSdkVersion in the build.gradle for the application, to the version corresponding to compile ‘com.android.support:appcompat-v7:’
I have compileSdkVersion 26, com.android.support:appcompat-v7: 26.1.0
mac os hight sierra android studio 3.1 system