New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Method return type must not include a type variable or wildcard #22
Comments
Same thing |
@7va can you share the Scarlet portions of your build.gradle? Changing to
for me. |
In my case @dkambersky this is how my Gradle looks like: |
I had the same issue, but finally managed to make it work like this: interface MyService {
@Receive
fun observeOnConnectionOpenedEvent(): Flowable<WebSocket.Event>
} and then: myService.observeOnConnectionOpenedEvent().subscribe {
when (it) {
is WebSocket.Event.OnConnectionOpened<*> -> Log.d("Socket", "Connection opened")
is WebSocket.Event.OnConnectionClosing -> Log.d("Socket", "Connection closing")
is WebSocket.Event.OnConnectionClosed -> Log.d("Socket", "Connection closed")
is WebSocket.Event.OnConnectionFailed -> Log.e("Socket", "Connection failed", it.throwable)
is WebSocket.Event.OnMessageReceived -> Log.d("Socket", "Message received")
else -> Log.d("Socket", it.toString())
}
} |
@dkambersky I think you might have forgotten to add a |
Fix #22: Update Usage example on README.md to match current implement…
I'm getting the following error:
IllegalArgumentException: Method return type must not include a type variable or wildcard: io.reactivex.Flowable<com.tinder.scarlet.WebSocket$Event$OnConnectionOpened<?>>
at
@Receive fun observeOnConnectionOpenedEvent(): Flowable<WebSocket.Event.OnConnectionOpened<*>>
fun <T> create(service: Class<T>): T { val clientBuilder = OkHttpClient.Builder() clientBuilder.addInterceptor(AuthInterceptor() val scarlet = Scarlet.Builder() .webSocketFactory(clientBuilder.build().newWebSocketFactory(ApiEndPoint.WEBSOCKET)) .addMessageAdapterFactory(GsonMessageAdapter.Factory()) .addStreamAdapterFactory(RxJava2StreamAdapterFactory()) .build() return scarlet.create(service) }
val websocketApi = BaseScarletBuilder.create(WebsocketApi::class.java)
Is this the way we are suppose to use the lib?
The text was updated successfully, but these errors were encountered: