I\'m trying to figure out why the heck my Android studio isn\'t recognizing the AppCompat v7 library correctly. The import statement below shows up as gray and says there\'s
I had the same problem in my newly started project with minimum api 23, and finally i have added these lines of codes in my gradle dependency file and it solved the error:)
implementation 'com.android.support:appcompat-v7:28.0.0'
implementation 'com.android.support:customtabs:28.0.0'
implementation 'com.android.support:support-vector-drawable:28.0.0'
implementation 'com.android.support:support-media-compat:28.0.0'
Delete .idea folder in your project which is hidden folder. Goto your project in the system and Click ctrl+H it will be visible then delete it. Now restart your android studio.I will resolve. Its working for me.
Include import androidx.appcompat.app.AppCompatActivity; in your MainActivity.java with other import statements. This would look like:
this resolved my issue
I got the same exact error with In case it helps others .. documenting what worked for me useful for very latest (Jan 14, 2017) latest everything. Tried all the Invalidate, build clean, even deleting .gradle/, tweaking the support libs etc.. on multiple stack overflow answers.
I found that upgrading the settings.gradle gradle version fixed it (it was 2.1.3) something in gradle toolchain seems to classpath 'com.android.tools.build:gradle:2.2.3'
I changed from "... extends ActionBarActivity" to "... extends AppCompatActivity" and tried cleaning, restarting, Invalidate Caches / Restart and wasn't getting anywhere. All my versions were up to the latest.
What finally solved it was making sure my import was correct:
import android.support.v7.app.AppCompatActivity;
For some reason it didn't get set up automatically like I was used to and I had to add it manually.
Hope that helps someone!
We don´t need to delete files, just invalidate caches to restart configuration: