question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Unable to use in Android 23 due to noclassdeffounderror: ljava/util/optional

See original GitHub issue

Issue: Unable to use (iota-java:1.0.0-beta2) on Android API < 24 due to the usage of java.util.Optional in Signing.java

There is still a considerable percentage (~22%) of Android users on API 23 Marshmallow. It would be great to set the compatibility, so, that there will be no surprises on Android.

E/AndroidRuntime: FATAL EXCEPTION: main
    Process: amiin.bazouk.application.com.demo_bytes_android, PID: 3110
    java.lang.NoClassDefFoundError: Failed resolution of: Ljava/util/Optional;
        at jota.utils.Signing.<init>(Signing.java:30)
        at jota.utils.IotaAPIUtils.newAddress(IotaAPIUtils.java:39)
        at jota.IotaAPI.generateNewAddresses(IotaAPI.java:148)
        at jota.IotaAPI.getNextAvailableAddress(IotaAPI.java:81)
        at amiin.bazouk.application.com.demo_bytes_android.iota.Iota.getCurrentAddress(Iota.java:88)
        at amiin.bazouk.application.com.demo_bytes_android.iota.Account.getCurrentAddress(Account.java:85)
        at amiin.bazouk.application.com.demo_bytes_android.MainActivity.getBalance(MainActivity.java:762)
        at amiin.bazouk.application.com.demo_bytes_android.MainActivity.access$1600(MainActivity.java:61)
        at amiin.bazouk.application.com.demo_bytes_android.MainActivity$6.onClick(MainActivity.java:244)
        at android.view.View.performClick(View.java:5198)

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:10 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
ezieneckercommented, May 20, 2020

@kwek20 No feedback on this topic for almost a year and a half. Can’t we close the ticket?

0reactions
kwek20commented, Nov 19, 2018

Hey @pasupulaphani,

I see in the StreamSupport issue, they mentioned ProGuard. Did you try that? Seems to be a good solution, we wont need to go backwards or implement a library, and you can use it in android <24.

If you make a new jar out of our latest release, using ProGuard, and link to that jar when building for Android, that seems to solve the problem.

Otherwise it would be in the 1.0.0 final release, no ETA yet though, we are still scoping functionality.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to fix java.lang.NoClassDefFoundError on android api ...
My application runs fine with my android api level 23 , when I tried to run it on another android api level 19...
Read more >
NoClassDefFoundError - Android Developers
NoClassDefFoundError ; NoClassDefFoundError ... as part of creating a new instance using the new expression) and no definition of the class could be...
Read more >
How to Resolve the NoClassDefFoundError in Java - Rollbar
NoClassDefFoundError is a Java error that occurs when the JVM is unable to find a class at runtime which was available at compile-time....
Read more >
Andriod API < 24 -> NoClassDefFoundError: Failed resolution of
With mockito-android 3.5.15 on Android API 23 we are getting this error below, it works fine with 3.4.6.
Read more >
crash in Android IMA sdk 3.11.0 - Google Groups
NoClassDefFoundError Failed resolution of ConcurrentHashMap; crash in Android IMA ... since upgrade of the Android IMA SDK 3.11.0 I am getting the crash....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found