The problem you're facing is a configuration issue. To fix make sure the agp version in the project structure is matching the version in lib.versions.toml then sync.