Cannot access 'androidx.activity.result.ActivityResultCaller'

This happened because of Gradle when resolving dependency libraries versions upgraded androidx.core:core to version more than 1.2.0, probably to 1.3.0-beta01 or 1.3.0-rc01

AppCompatActivity extends FragmentActivity that extends ComponentActivity that extends androidx.core.app.ComponentActivity that implements ActivityResultCaller introduced in androidx.activity:activity:1.2.0-alpha03 only.

To resolve this issue add this dependency to your module build.gradle:

dependencies {
      implementation "androidx.activity:activity-ktx:1.2.0-alpha03"
}

In my case, turns out I had conflicting androidx.activity:activity-ktx gradle dependencies between my core/base and app module.

In addition to ActivityResultCaller, mine was throwing an issue with ActivityResultRegistryOwner.

For me, removing the dependency from the app module, pushing the core module dependency to androidx.activity:activity-ktx:1.2.0-alpha04 and bumping implementation "androidx.core:core-ktx:1.3.0 > 1.3.1 solved both issues.

I also have an androidx.appcompat:appcompat:1.3.0-alpha01 dependency in core, which I kept, but it seems removing it has no effect.