You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Running my app using JNA 5.3.0 on OS versions prior to Android 8.0 (API level 26) results in the following stack trace:
--------- beginning of crash
04-24 17:02:35.617 12484-12484/? E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.bugsbegone.myapp, PID: 12484
java.lang.NoClassDefFoundError: Failed resolution of: Ljava/lang/invoke/MethodType;
at com.sun.jna.internal.ReflectionUtils.(ReflectionUtils.java:77)
at com.sun.jna.internal.ReflectionUtils.isDefault(ReflectionUtils.java:135)
at com.sun.jna.Library$Handler.invoke(Library.java:231)
at java.lang.reflect.Proxy.invoke(Proxy.java:393)
at com.bugsbegone.myapp.$Proxy2.mylib_init(Unknown Source)
[... My app specific trace ...]
at android.app.Activity.performCreate(Activity.java:6270)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1107)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2382)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2493)
at android.app.ActivityThread.access$1000(ActivityThread.java:150)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1357)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:148)
at android.app.ActivityThread.main(ActivityThread.java:5446)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:743)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:633)
Caused by: java.lang.ClassNotFoundException: Didn't find class "java.lang.invoke.MethodType" on path:
DexPathList[[zip file "/data/app/com.bugsbegone.myapp-1/base.apk",
zip file "/data/app/com.bugsbegone.myapp-1/split_lib_dependencies_apk.apk",
zip file "/data/app/com.bugsbegone.myapp-1/split_lib_slice_0_apk.apk",
[... lots of slices ...]
zip file "/data/app/com.bugsbegone.myapp-1/split_lib_slice_9_apk.apk"],
nativeLibraryDirectories=[/data/app/com.bugsbegone.myapp-1/lib/x86_64,
/data/app/com.bugsbegone.myapp-1/base.apk!/lib/x86_64,
/data/app/com.bugsbegone.myapp-1/split_lib_dependencies_apk.apk!/lib/x86_64,
/data/app/com.bugsbegone.myapp-1/split_lib_slice_0_apk.apk!/lib/x86_64,
[... lots of slices ...]
/data/app/com.bugsbegone.myapp-1/split_lib_slice_9_apk.apk!/lib/x86_64,
/vendor/lib64, /system/lib64]]
at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)
at java.lang.ClassLoader.loadClass(ClassLoader.java:511)
at java.lang.ClassLoader.loadClass(ClassLoader.java:469)
at com.sun.jna.internal.ReflectionUtils.(ReflectionUtils.java:77)
at com.sun.jna.internal.ReflectionUtils.isDefault(ReflectionUtils.java:135)
at com.sun.jna.Library$Handler.invoke(Library.java:231)
at java.lang.reflect.Proxy.invoke(Proxy.java:393)
at com.bugsbegone.myapp.$Proxy2.mylib_init(Unknown Source)
[... My app specific trace ...]
at android.app.Activity.performCreate(Activity.java:6270)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1107)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2382)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2493)
at android.app.ActivityThread.access$1000(ActivityThread.java:150)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1357)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:148)
at android.app.ActivityThread.main(ActivityThread.java:5446)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:743)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:633)
Suppressed: java.lang.ClassNotFoundException: java.lang.invoke.MethodType
at java.lang.Class.classForName(Native Method)
at java.lang.BootClassLoader.findClass(ClassLoader.java:781)
at java.lang.BootClassLoader.loadClass(ClassLoader.java:841)
at java.lang.ClassLoader.loadClass(ClassLoader.java:504)
... 21 more
Caused by: java.lang.NoClassDefFoundError: Class not found using the boot class loader; no stack trace available
It would be a shame to have to undo this new feature for backwards compatibility, but it does wipe out JNA support on >75% of current android devices.
Maybe a separate branch for Android would be the best way to allow bug fixes etc. to continue, but without any of the unsupported Java7+ features?
The text was updated successfully, but these errors were encountered:
Reported on the mailinglist:
Running my app using JNA 5.3.0 on OS versions prior to Android 8.0 (API level 26) results in the following stack trace:
04-24 17:02:35.617 12484-12484/? E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.bugsbegone.myapp, PID: 12484
java.lang.NoClassDefFoundError: Failed resolution of: Ljava/lang/invoke/MethodType;
at com.sun.jna.internal.ReflectionUtils.(ReflectionUtils.java:77)
at com.sun.jna.internal.ReflectionUtils.isDefault(ReflectionUtils.java:135)
at com.sun.jna.Library$Handler.invoke(Library.java:231)
at java.lang.reflect.Proxy.invoke(Proxy.java:393)
at com.bugsbegone.myapp.$Proxy2.mylib_init(Unknown Source)
[... My app specific trace ...]
at android.app.Activity.performCreate(Activity.java:6270)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1107)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2382)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2493)
at android.app.ActivityThread.access$1000(ActivityThread.java:150)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1357)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:148)
at android.app.ActivityThread.main(ActivityThread.java:5446)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:743)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:633)
Caused by: java.lang.ClassNotFoundException: Didn't find class "java.lang.invoke.MethodType" on path:
DexPathList[[zip file "/data/app/com.bugsbegone.myapp-1/base.apk",
zip file "/data/app/com.bugsbegone.myapp-1/split_lib_dependencies_apk.apk",
zip file "/data/app/com.bugsbegone.myapp-1/split_lib_slice_0_apk.apk",
[... lots of slices ...]
zip file "/data/app/com.bugsbegone.myapp-1/split_lib_slice_9_apk.apk"],
nativeLibraryDirectories=[/data/app/com.bugsbegone.myapp-1/lib/x86_64,
/data/app/com.bugsbegone.myapp-1/base.apk!/lib/x86_64,
/data/app/com.bugsbegone.myapp-1/split_lib_dependencies_apk.apk!/lib/x86_64,
/data/app/com.bugsbegone.myapp-1/split_lib_slice_0_apk.apk!/lib/x86_64,
[... lots of slices ...]
/data/app/com.bugsbegone.myapp-1/split_lib_slice_9_apk.apk!/lib/x86_64,
/vendor/lib64, /system/lib64]]
at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)
at java.lang.ClassLoader.loadClass(ClassLoader.java:511)
at java.lang.ClassLoader.loadClass(ClassLoader.java:469)
at com.sun.jna.internal.ReflectionUtils.(ReflectionUtils.java:77)
at com.sun.jna.internal.ReflectionUtils.isDefault(ReflectionUtils.java:135)
at com.sun.jna.Library$Handler.invoke(Library.java:231)
at java.lang.reflect.Proxy.invoke(Proxy.java:393)
at com.bugsbegone.myapp.$Proxy2.mylib_init(Unknown Source)
[... My app specific trace ...]
at android.app.Activity.performCreate(Activity.java:6270)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1107)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2382)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2493)
at android.app.ActivityThread.access$1000(ActivityThread.java:150)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1357)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:148)
at android.app.ActivityThread.main(ActivityThread.java:5446)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:743)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:633)
Suppressed: java.lang.ClassNotFoundException: java.lang.invoke.MethodType
at java.lang.Class.classForName(Native Method)
at java.lang.BootClassLoader.findClass(ClassLoader.java:781)
at java.lang.BootClassLoader.loadClass(ClassLoader.java:841)
at java.lang.ClassLoader.loadClass(ClassLoader.java:504)
... 21 more
Caused by: java.lang.NoClassDefFoundError: Class not found using the boot class loader; no stack trace available
The breaking change is [GITHUB-813] Support binding interfaces containing default methods, which resolves #813.
Unfortunately, the MethodType class doesn't exist in Android until API level 26 (https://developer.android.com/reference/java/lang/invoke/MethodType).
It would be a shame to have to undo this new feature for backwards compatibility, but it does wipe out JNA support on >75% of current android devices.
Maybe a separate branch for Android would be the best way to allow bug fixes etc. to continue, but without any of the unsupported Java7+ features?
The text was updated successfully, but these errors were encountered: