p-lr / MapView

A Fast, memory efficient Android library to display tiled maps, with support for markers, paths, and rotation.
Apache License 2.0
184 stars 38 forks source link

BufferOverflow on Channel coroutine #26

Closed gzalez closed 3 years ago

gzalez commented 3 years ago

Hi,

I'm trying to use the library in a Java Fragment, and I'm getting this error when set configuration to map (mapView.configure(config);)

java.lang.NoSuchMethodError: No static method Channel$default(ILkotlinx/coroutines/channels/BufferOverflow;Lkotlin/jvm/functions/Function1;ILjava/lang/Object;)Lkotlinx/coroutines/channels/Channel; in class Lkotlinx/coroutines/channels/ChannelKt; or its super classes (declaration of 'kotlinx.coroutines.channels.ChannelKt' at ovh.plrapps.mapview.core.ThrottleKt.throttle(Throttle.kt:21) at ovh.plrapps.mapview.viewmodel.TileCanvasViewModel.(TileCanvasViewModel.kt:35) at ovh.plrapps.mapview.MapView.configure(MapView.kt:107)

p-lr commented 3 years ago

Hi,

Which version of the library are you using? The latest version (3.1.0) depends on kotlinx.coroutines 1.5.0. Make sure your project doesn't depend on a previous version (1.4.x or below), either directly or transitively. If it does, you can try using MapView 3.0.0

gzalez commented 3 years ago
            Thank you! I fix it!

            I was using an older version of kotlinx.coroutines and I was not including kotlin-coroutines-android. That’s why it appears that unhandled exception.

            Regards.
p-lr commented 3 years ago

Great! Closing this for now.