Skip to content
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

java.lang.NoSuchMethodError: java.util.List.sort(Ljava/util/Comparator;)V #555

Closed
timmolter opened this issue Jan 26, 2021 · 9 comments
Closed

Comments

@timmolter
Copy link

timmolter commented Jan 26, 2021

Please ensure you have given all the following requested information in your report.

Issue details

Getting a NoSuchMethodError for a Java8+ Streaming call: List.sort(Object::compareTo). I could update the library code to Collections.sort(list, comparator), but it would be very time consuming and a non-desirable approach. Is there something I'm missing here with using RoboVM?

java.lang.NoSuchMethodError: java.util.List.sort(Ljava/util/Comparator;)V
at com.hedera.hashgraph.sdk.Network.getNodeAccountIdsForExecute(Network.java:89)

Hedera project code line reference here:
https://github.com/hashgraph/hedera-sdk-java/blob/c6dc4a0e9fb3f28297abfbefa17f2d02996f7b3d/sdk/src/main/java/com/hedera/hashgraph/sdk/Network.java#L89

Versions:

Please provide the version of RoboVM, XCode and JDK used

  • Robovm: 2.3.12
  • XCode: 12.3
  • JDK: 8
@dkimitsa
Copy link
Contributor

@timmolter current RoboVM runtime doesn't support Java8 APIs like streams. Its compatible with Android 4.4 one.

@timmolter
Copy link
Author

@dkimitsa Thanks for the quick answer!

"Its compatible with Android 4.4 one." - What do you mean by this exactly?

Does RoboVM plan to support Java8 APIs anytime soon?

@MobiDevelop
Copy link
Member

The Java API supported is that of Android 4.4 - which is, generally, Java 7 APIs.

@dkimitsa
Copy link
Contributor

@timmolter
this issue is duplicate of #514, #259

Does RoboVM plan to support Java8 APIs anytime soon?

there is work in progress that brings Android10 Java runtime, which is Java8+ API #527

@davidgiga1993
Copy link

Would it be possible to have a compile time error for this? I mostly notice these issues after release since I can't test every platform each time.

@obigu
Copy link
Contributor

obigu commented Feb 13, 2021 via email

@dkimitsa
Copy link
Contributor

@obigu its a problem when third party dependency using such api

@davidgiga1993
Copy link

@obigu No because some java 8 features are working fine and I heavily use them (for example lambdas for event listeners)
If I change the build level to 7 I can't use those anymore.

@timmolter
Copy link
Author

timmolter commented Feb 16, 2021

I ended up changing the lib's code to Java 7 API: hashgraph/hedera-sdk-java#451

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants