2

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, ...

AVEbrahimi
  • 17,993
  • 23
  • 107
  • 210

2 Answers2

2

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

AndroidEngineX
  • 975
  • 1
  • 9
  • 22
0

In 1.2.0, it added ktx dependencies. It is already posted in Google's issue tracker, but seems Google would not fix it.

https://issuetracker.google.com/issues/238425626

You can have two ways to resolve the issue.

  1. Force using 1.1.1

build.gradle > dependencies

implementation 'androidx.preference:preference:1.1.1'
  1. Remove ktx dependencies from 1.2.0

build.gradle > dependencies

implementation('androidx.preference:preference:1.2.0') {
    exclude group: 'androidx.lifecycle', module:'lifecycle-viewmodel'
    exclude group: 'androidx.lifecycle', module:'lifecycle-viewmodel-ktx'
}
Chester Fung
  • 182
  • 1
  • 10