define android support v7 app appcompatactivity in build gradle code example
Example: import android.support.v7.app.appcompatactivity error
//if you are using androidx......
import android.support.v7.app.AppCompatActivity;
//to
import androidx.appcompat.app.AppCompatActivity;