'Weird behavior after upgrading to androidx.preference:preference-ktx:1.2.0

I am using Google Map in my Android app, was working properly, now after upgrading

androidx.preference:preference-ktx from 1.1.0 to 1.2.0,

Google Maps stopped displaying map tiles, but everything else is working, tap on map works, ...



Solution 1:[1]

Hi did you check the dependencies androidx.preference:preference-ktx:1.2.0 brought? It is possible that some transitive dependency of androidx.preference:preference-ktx:1.2.0 may have caused the update to the same transitive dependency of the Google map library. See Gradle dependency resolution for more info

Also you can print the dependencies tree using the command ./gradlew app:dependencies where app is the name of the application Gradle project. See SO post for the same

To fix the issue you have to manually resolve the dependency using below Gradle code

configurations.all {
    resolutionStrategy.eachDependency { DependencyResolveDetails details ->
        if (details.requested.group == 'culprit dependency group' && details.requested.name == 'culprit dependency version') {
            details.useVersion 'fixing version'
            details.because 'reason why we have fixed the version'
        }
    }
}

Details bout dependency resolution at link

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 AndroidEngineX