Hi all,
1st let me thank you for the great job with clojure-android, this is
great! I never jumped into Android dev because Java bore me to death,
but developing in Clojure brings the fun back :) !
While developing a simple app to manage tethering more easily
(scratching my own itch here) I ran into a problem with recent Android
SDK: skummet clojure.lang.Var:derefLean() catches
java.lang.ReflectiveOperationException which has been introduced in
Android 19 - meaning you cannot use skummet for Android < 19.
Clojure-android advertises android 15+ compatibility, and moreover my
phone is running Android 17, so I really want skummet to work with it :)
The strange thing is that it had worked at some point in the past... But
it does no longer work. I suspect an update to the Android SDK
introduced more checks in that area...
My short term solution is to workaround that by implementing my own
javal.lang.ReflectiveOperationException:
https://github.com/bganne/autoteth/commit/da5a06d1d7aa08065110af4ace1b577a5172177e
That actually works for me. But it might be better to change skummet to
catch java.lang.Exception instead?
If I do not implement my workaround, I get a VerifyError. As it is
thrown by Dalvik itself, I cannot catch it:
W/dalvikvm( 1784): VFY: unable to resolve exception class 1211
(Ljava/lang/ReflectiveOperationException;)
W/dalvikvm( 1784): VFY: unable to find exception handler at addr 0x55
W/dalvikvm( 1784): VFY: rejected Lclojure/lang/Var;.derefLean
()Ljava/lang/Object;
W/dalvikvm( 1784): VFY: rejecting opcode 0x0d at 0x0055
W/dalvikvm( 1784): VFY: rejected Lclojure/lang/Var;.derefLean
()Ljava/lang/Object;
W/dalvikvm( 1784): Verifier rejected class Lclojure/lang/Var;
W/dalvikvm( 1784): Exception Ljava/lang/VerifyError; thrown while
initializing Lfr/benou/autoteth/bt/main;
W/dalvikvm( 1784): Class init failed in newInstance call
(Lfr/benou/autoteth/bt/main;)
D/AndroidRuntime( 1784): Shutting down VM
ben