Open rabipelais opened 8 years ago
From the stacktrace it seems like CardView contains static initialization that requires Android runtime. This is connected to the old-standing bug in Clojure: importing classes triggers their static initializers (see http://dev.clojure.org/jira/browse/CLJ-1315, http://dev.clojure.org/jira/browse/CLJ-1743).
The only thing I can recommend right now is to extend CardView in your project using Java (like, creating MyCardView.java
class with just public class MyCardView extends CardView {}
) and using it. As far as I understand the problem, it should work.
And then use defelement
with :classname MyCardView
?
Yes.
Sadly, this didn't seem to work. Still getting the same error
Meh, that's unfortunate. What if you replaced android.support.v7.widget.CardView
in your code with (resolve 'android.support.v7.widget.CardView)
?
Still the same error. It seems I will have to use a patched compiler.
If I run
lein droid doall
and the main file contains(defelement :card-view :classname android.support.v7.widget.CardView :inherits :frame-layout)
I get the following error:
note that compiling with
RecyclerView
or others produce no errors.