“IBitmapDescriptorFactory is not initialized” error

后端 未结 7 790
小鲜肉
小鲜肉 2021-01-31 13:52

I\'m trying to get a marker with an custom icon in Google Maps Android API v2. I just changed one of the examples Google provides. I added .icon(BitmapDescriptorFactory.fr

7条回答
  •  [愿得一人]
    2021-01-31 14:06

    See Custom marker in google maps in android with vector asset icon.

    In my case I had markers over Google Maps. But on API 19 emulator there is a problem with Google Play Services. So this error is misleading, Google Play Services tried to create BitmapDescriptor, but could not.

    You should create markers in onMapReady(), also move there any other code, working with Google Maps.

    If you have problems with showing Google Maps on Android 4, maybe you should downgrade a library from 16.1.0 to 16.0.0, see https://stackoverflow.com/a/54772374/2914140. But if you do so, you will get a crash on Androif 9, see Google Maps crashing on Android Pie.

提交回复
热议问题