Runtime Exception w/ Java 8 Lambas in Android
See original GitHub issueI 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…
Issue Analytics
- State:
- Created 5 years ago
- Comments:19 (14 by maintainers)
Top Results From Across the Web
Java 8 Lambda function that throws exception? - Stack Overflow
The default behavior is that when your throwing lambda throws a checked exception, a ThrownByLambdaException is thrown with the checked ...
Read more >Exceptions in Java 8 Lambda Expressions - Baeldung
A quick and practical guide to dealing with Lambda Expressions and exceptions.
Read more >What are the rules to follow while using exceptions in java ...
The lambda expressions can't be executed on their own. It is used to implement methods that have declared in a functional interface.
Read more >Using Java 8 Lambda expressions in Android
A guide on using Java 8 lambda expressions in Android. ... If a single expression is specified, the java runtime evaluates the expression ......
Read more >Use Java 8 language features and APIs - Android Developers
Note that Android does not support the serialization of lambda expressions. Method references · Type annotations, Type annotation information is ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

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