I had the same error today, and this is what fixed it for me: check in all your library modules for this import in the build.gradle
files (you can search in Android Studio in the Edit → Find → Find in Files… menu option):
implementation 'androidx.core:core-ktx:+'
Replace it with the latest stable version to avoid the error:
implementation 'androidx.core:core-ktx:1.9.0'
Synchronise your project and the errors should be gone!