I went through the same situation and the fix was quiet easy. Just try removing the following import statement.
import android.support.v7.app.AppCompatActivity;
A message will be prompted with the below code, also asking you to press alt+enter.
import androidx.appcompat.app.AppCompatActivity;
Just press alt+enter and remove the previous import statement completely.
Basically this problem arises in new version of Android Studio.