SandroHc/reactive-jikan

NoClassDefFoundError on Android 7.0/7.1

fbaierl opened this issue · 2 comments

I have encountered an exception that only seems to appear on Android 7.0 and 7.1 devices (at least so far). Not sure how to fix this yet, but I'll just post the Stacktrace here for now:

java.lang.NoClassDefFoundError: 
  at reactor.netty.resources.ConnectionProvider$ConnectionPoolSpec.<init> (ConnectionProvider.java:458)
  at reactor.netty.resources.ConnectionProvider$ConnectionPoolSpec.<init> (ConnectionProvider.java:452)
  at reactor.netty.resources.ConnectionProvider$Builder.<init> (ConnectionProvider.java:404)
  at reactor.netty.resources.ConnectionProvider$Builder.<init> (ConnectionProvider.java:393)
  at reactor.netty.resources.ConnectionProvider.builder (ConnectionProvider.java:103)
  at reactor.netty.tcp.TcpResources.create (TcpResources.java:346)
  at reactor.netty.tcp.TcpResources.getOrCreate (TcpResources.java:290)
  at reactor.netty.http.HttpResources.get (HttpResources.java:42)
  at reactor.netty.http.client.HttpClient.create (HttpClient.java:390)
  at net.sandrohc.jikan.Jikan.<init> (Jikan.java:61)
  at net.sandrohc.jikan.Jikan.<init> (Jikan.java:52)

Btw: thanks a lot for accepting my last PR. It's good to see this lib being maintained since so far I think it's the best when it comes to interacting with the Jikan API from Java. :)

I was unable to reproduce the issue as I could not start an Android emulator (clashes with Hyper-V). The class ConnectionProvider is part of reactor-netty-core, which should have come with the reactor-netty dependency.

Can you try adding that dependency to your project?
If using Gradle, add this to your dependencies: implementation 'io.projectreactor.netty:reactor-netty-core:1.0.1'

Unfortunately that does not seem to help.

I have been having problems with netty on android for quite some time. Pretty sure it is not related to your library, but a compatibility issue between android and netty. For now I restricted my app for Android 8 and higher and I am still using io.projectreactor.netty:reactor-netty:0.9.10.RELEASE instead of version 1.0.1 (which also does not work correctly).

Anyway this does not seem to be a bug inside this lib, so I guess I will close this issue.