clojure-android / neko

The Clojure/Android Toolkit
Other
297 stars 36 forks source link

Why Emacs Cider ` C-c C-k ` run the main.clj, it will erro: "android.app.VoiceInteractor is no found " #66

Open xlisp opened 8 years ago

xlisp commented 8 years ago

I create a lein droid project by lein new droid project your.project, then run lein droid doall success create apk and install apk to my Android. So i open the repl lein droid repl , and test (on-ui (neko.notify/toast "Hello")) , my Android will notify "Hello" ok . But I use Emacs Cider connect the repl (localhost:9999) , then run C-c C-k , it will Erro :
erro

I don't know how to do, i try import VoiceInteractor class , but it's failed.

Thanks :-)

xlisp commented 8 years ago

The Problem is fixed in Android 5.0 (API 21) :-)

alexander-yakushev commented 8 years ago

@chanshunli That's interesting. So, it didn't work until you changed :target-version to 21?

xlisp commented 8 years ago

@alexander-yakushev ,Thanks for your reply , None of :target-version ( I try test it in Android 4 and :target-version 19, but it‘s erro “VoiceInteractor no found ” ) . it's work ok in Android 5.0 (API 21) .

alexander-yakushev commented 8 years ago

This class (VoiceInteractor) was introduced in API 23. The exception happens because something in cider-nrepl uses reflection to inspect Activity's methods, and apparently your Activity has a compiled in reference to VoiceInteractor. This makes me think that you are actually building your app against :target-version 23. Could you please double-check that target-version is set correctly? You can do DEBUG=1 lein droid doall to see which Android jar goes to classpath.