mcarleio / konvert

This kotlin compiler plugin is using KSP API and generates kotlin code to map one class to another
https://mcarleio.github.io/konvert/
Apache License 2.0
86 stars 8 forks source link

Fix konvert annotation for api <25 #32

Closed mkowol-n closed 8 months ago

mkowol-n commented 8 months ago

For android api <25 we are getting an error:

java.lang.NoSuchMethodError: No virtual method getParameterCount()I in class Ljava/lang/reflect/Constructor; or its super classes (declaration of 'java.lang.reflect.Constructor' appears in /system/framework/core-libart.jar)

This change fixes the issue

mcarleio commented 8 months ago

Thanks for this PR :+1: Is Android API <25 not supporting Java 1.8 features? :astonished:

jakoss commented 8 months ago

Thanks for this PR 👍 Is Android API <25 not supporting Java 1.8 features? 😲

Quite complicated topic, Android is using JDK for building the class files, but has to implement all the functions in runtime themselves - due to licensing issues with oracle. So they are using APIs of the JDK, but runtime is completely different from JDK/JRE.

They support a lot of Java 1.8 features on older SDKs by process of "desugaring" (https://developer.android.com/studio/write/java8-support). But i guess desugaring does not contain getParameterCount() (full support table: https://developer.android.com/studio/write/java8-support-table)

mcarleio commented 8 months ago

Thanks for the info, did not know that! Hope it is working with the next release then.