Problem solved for me after updating dependencies in gradle as and set the compilesdk and targetsdk to 34
implementation 'androidx.appcompat:appcompat:1.6.1' implementation 'androidx.constraintlayout:constraintlayout:2.1.4'