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

NoSuchMethodError for android 6 #33

Closed
jakoss opened this issue Feb 17, 2020 · 10 comments · Fixed by #35
Closed

NoSuchMethodError for android 6 #33

jakoss opened this issue Feb 17, 2020 · 10 comments · Fixed by #35

Comments

@jakoss
Copy link

jakoss commented Feb 17, 2020

I cannot run xxHash on devices running android 6. Stacktrace:

java.lang.NoSuchMethodError: No virtual method getByte(Ljava/lang/Object;J)B in class Lsun/misc/Unsafe; or its super classes (declaration of 'sun.misc.Unsafe' appears in /system/framework/core-libart.jar)
        at net.openhft.hashing.UnsafeAccess.getByte(UnsafeAccess.java:87)
        at net.openhft.hashing.UnsafeAccess.getUnsignedByte(UnsafeAccess.java:82)
        at net.openhft.hashing.XxHash.fetch8(XxHash.java:51)
        at net.openhft.hashing.XxHash.xxHash64(XxHash.java:150)
        at net.openhft.hashing.XxHash$AsLongHashFunction.hash(XxHash.java:272)
        at net.openhft.hashing.LongHashFunction.unsafeHash(LongHashFunction.java:453)
        at net.openhft.hashing.LongHashFunction.hashBytes(LongHashFunction.java:494)
@gzm55
Copy link
Collaborator

gzm55 commented Feb 22, 2020

Unsafe.getByte() comes from android 7 (api level 24). so maybe we can use getInt(ofs - 3) >> 24 as a work around.

@gzm55
Copy link
Collaborator

gzm55 commented Feb 23, 2020

#35 should fix this issue.

New ut from this pr are passed in android instrumentation tests on an Android 4.4.2 (API 19) emulator.

@jakoss
Copy link
Author

jakoss commented Feb 24, 2020

Great! When could this be merged into master? Or maybe you could provide me some snapshot on maven so i could test this?

@gzm55
Copy link
Collaborator

gzm55 commented Feb 24, 2020

about merging, @leventov do u have time to review #35?
about snapshot, @NekroMancer just clone my fork, and mvn install on your machine.

@dpisklov
Copy link
Contributor

@gzm55 PR merged, thanks

@jakoss
Copy link
Author

jakoss commented Feb 25, 2020

Works great. Is there release coming?

@dpisklov
Copy link
Contributor

@NekroMancer @gzm55 zero-allocation-hashing-0.11 is released

@jakoss
Copy link
Author

jakoss commented Feb 25, 2020

Great! Will it get released on sonatype too?

@dpisklov
Copy link
Contributor

It is there, it just will take time to propagate through - should be available in a few hours, as usual with sonatype...

@jakoss
Copy link
Author

jakoss commented Feb 25, 2020

Ok, thanks

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

Successfully merging a pull request may close this issue.

3 participants