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

Didn't find class "java.nio.file.Path" below Android api 26 #2466

Closed
KevynBct opened this issue Sep 19, 2019 · 2 comments
Closed

Didn't find class "java.nio.file.Path" below Android api 26 #2466

KevynBct opened this issue Sep 19, 2019 · 2 comments
Labels
android Issues related to use on Android platform
Milestone

Comments

@KevynBct
Copy link

Hello,

With the version 2.10.0.pr3, I've got an error on simulators (and certainly real devices) with an API below 26 :

09-19 17:16:36.077 26359-26359/XX.XXXXX.XXXXX E/AndroidRuntime: FATAL EXCEPTION: main Process: XX.XXXXX.XXXXX, PID: 26359 java.lang.NoClassDefFoundError: Failed resolution of: Ljava/nio/file/Path; at com.fasterxml.jackson.databind.ext.Java7HandlersImpl.getDeserializerForJavaNioFilePath(Java7HandlersImpl.java:20)

Caused by: java.lang.ClassNotFoundException: Didn't find class "java.nio.file.Path" on path: DexPathList[[zip file "/data/app/XX.XXXXX.XXXXX-1/base.apk", zip file "/data/app/XX.XXXXX.XXXXX-1/split_config.fr.apk", zip file "/data/app/XX.XXXXX.XXXXX-1/split_config.xxxhdpi.apk"],nativeLibraryDirectories=[/data/app/XX.XXXXX.XXXXX-1/lib/x86, /vendor/lib, /system/lib]] at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56) at java.lang.ClassLoader.loadClass(ClassLoader.java:511) at java.lang.ClassLoader.loadClass(ClassLoader.java:469)

@cowtowncoder cowtowncoder transferred this issue from FasterXML/jackson-module-kotlin Sep 19, 2019
@cowtowncoder
Copy link
Member

cowtowncoder commented Sep 19, 2019

I think this is not Kotlin-specifc, so moving to jackson-databind.
Most likely caused by imperfect handling of #2446

Thank you for reporting the problem! This sounds like regresssion? Code in question was refactored and it is possible that handling of not finding JDK 7 class got broken: intent is for missing class to be handled gracefully, to allow running on platforms like Android that have JavaSE 6 (or close) level compatibility.

Do you know (or can test) if 2.10.0.pr2 suffers from same issue? I am guessing it wouldn't (there would be a log statement indicating missing type or something, but no exception)

@cowtowncoder
Copy link
Member

Hmmh. Ok, I suspect this is because of my assuming that simply loading a class that depends on another class would trigger failure (on lines 23-24 of Java7Handlers), and that failure would be caught.

But based on symptoms, I guess loading works ok (alas!) and the problem comes from trying to call a method that actually refers to the class that is missing.

In hindsight this makes sense -- I think I will need to shuffle things around, and cause early failure, instead of deferred one.
The main challenge here is simply that I have no good way to test it.

@cowtowncoder cowtowncoder added this to the 2.10.0 milestone Sep 19, 2019
@cowtowncoder cowtowncoder changed the title Didn't find class "java.nio.file.Path" below api 26 Didn't find class "java.nio.file.Path" below Android api 26 Sep 19, 2019
@cowtowncoder cowtowncoder added 2.10 android Issues related to use on Android platform labels Sep 19, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
android Issues related to use on Android platform
Projects
None yet
Development

No branches or pull requests

2 participants