jeromq: Runtime Exception w/ Java 8 Lambas in Android
I did a build from the latest master snapshot on Github, and ran into this error when receiving data on the REP socket.
I/art: Rejecting re-init on previously-failed class java.lang.Class<zmq.io.StreamEngine$ProducePongMessage>
Rejecting re-init on previously-failed class java.lang.Class<zmq.io.StreamEngine$ProducePongMessage>
I/art: Rejecting re-init on previously-failed class java.lang.Class<zmq.io.-$$Lambda$StreamEngine$W0Gv5o5INYywwEmQ5W1uv6x5Tgw>
E/AndroidRuntime: FATAL EXCEPTION: iothread-2
Process: com.ravn.havoc, PID: 21413
java.lang.NoClassDefFoundError: zmq.io.-$$Lambda$StreamEngine$W0Gv5o5INYywwEmQ5W1uv6x5Tgw
at zmq.io.StreamEngine.<init>(StreamEngine.java:865)
at zmq.io.net.tcp.TcpConnecter.connectEvent(TcpConnecter.java:149)
at zmq.io.IOObject.connectEvent(IOObject.java:99)
at zmq.poll.Poller.run(Poller.java:267)
at java.lang.Thread.run(Thread.java:818)
The stack references these lines in StreamEngine.java:
private final Function<Msg, Boolean> processIdentity = this::processIdentityMsg;
private final Supplier<Msg> nextIdentity = this::identityMsg;
Its not clear to me why this is throwing the error…
About this issue
- Original URL
- State: closed
- Created 6 years ago
- Comments: 19 (14 by maintainers)
Commits related to this issue
- Problem: Some java packages are not present for every versions of Android" Solution: Provide alternatives for java.util.function classes, remove java.util.stream usage, and enforce checkstyle to forb... — committed to fredoboulo/jeromq by fredoboulo 5 years ago
- Problem: Some java packages are not present for every versions of Android Solution: Provide alternatives for java.util.function classes, remove java.util.stream usage, and enforce checkstyle to forbi... — committed to fredoboulo/jeromq by fredoboulo 5 years ago
- unregister: remove lambda usage This is another fix for #627. — committed to knuesel/jeromq by knuesel 5 years ago
- Merge pull request #736 from knuesel/fix/627 Fix for #627: Poller#unregister: remove usage of lambda — committed to zeromq/jeromq by trevorbernard 5 years ago
Sounds like a good time to cut a new release. Once the Changelog is updated then we’ll release a new version
I think I understand now, it’s not about the syntaxic sugar, but the fact that not every classes or packages are included in every flavour of Android.
I listed so far:
added in API level 24 java.util.function classes java.util.stream classes java.util.Optional java.lang.FunctionalInterface
added in API level 19 java.util.Objects
I was about to create a PR, I’m introducing removals of these usages. I just have a doubt about the 2 draft APIs, ZMQ.recvStream. @esahekmat you introduced them, would you mind if I remove them for the time being? Unless someone gets a better idea…
If someone can propose a more exhaustive list, that wuld be helpful, as well as a way to build the library with a given version of Android on Travis