I open the project (opensource) to see the implementation. Everything seems normal, but swears at 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?

    4 answers 4

    In AndroidStudio File->InvalidateCahces . You can still Build->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 paths to the classes that are stored in the cache are different, respectively. When you clear the cache, the system picks up the changes.

    • one
      Works! And why do I need to clear the cache every time? - Alexey Shtanko

    You can also click Sync Project with Gradle files . It helped me.

    Sync Project with Gradle files

      It helped me: install Compile Sdk Version on the latest. http://dominoc925.blogspot.ru/2014/11/fixing-android-studio-cannot-resolve.html

        I was helped by the compileSdkVersion change in the build.gradle for the application, to the corresponding version of 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