{"action":"created","issue":{"url":"https://api.github.com/repos/clojure-android/lein-droid/issues/148","repository_url":"https://api.github.com/repos/clojure-android/lein-droid","labels_url":"https://api.github.com/repos/clojure-android/lein-droid/issues/148/labels{/name}","comments_url":"https://api.github.com/repos/clojure-android/lein-droid/issues/148/comments","events_url":"https://api.github.com/repos/clojure-android/lein-droid/issues/148/events","html_url":"https://github.com/clojure-android/lein-droid/issues/148","id":142633279,"number":148,"title":"startActivityForResult => Exception raised on UI thread (for :target-version \"23\", device 22)","user":{"login":"satchit8","id":17215326,"avatar_url":"https://avatars.githubusercontent.com/u/17215326?v=3","gravatar_id":"","url":"https://api.github.com/users/satchit8","html_url":"https://github.com/satchit8","followers_url":"https://api.github.com/users/satchit8/followers","following_url":"https://api.github.com/users/satchit8/following{/other_user}","gists_url":"https://api.github.com/users/satchit8/gists{/gist_id}","starred_url":"https://api.github.com/users/satchit8/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/satchit8/subscriptions","organizations_url":"https://api.github.com/users/satchit8/orgs","repos_url":"https://api.github.com/users/satchit8/repos","events_url":"https://api.github.com/users/satchit8/events{/privacy}","received_events_url":"https://api.github.com/users/satchit8/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2016-03-22T12:19:32Z","updated_at":"2016-03-23T03:21:41Z","closed_at":null,"body":"Reproduction steps:\r\n\r\n1) Create project with :target-sdk 23:\r\n\r\n     lein new droid coa-problem org.example.coaproblem :target-sdk 23\r\n\r\n2) Edit src/clojure/org/example/coaproblem/main.clj to use\r\n   startActivityForResult, e.g. via a button\r\n\r\n3) Appropriately connect device with Android 5.1.1 (22) and compile/install/run:\r\n\r\n     lein droid doall\r\n\r\n4) After app launches press button and observe toast indicating error,\r\n   and observe device logs:\r\n\r\n     adb logcat\r\n\r\nE/neko.debug(29773): Exception raised on UI thread.\r\nE/neko.debug(29773): java.lang.NoClassDefFoundError: android.view.SearchEvent\r\nE/neko.debug(29773): \tat libcore.reflect.InternalNames.getClass(InternalNames.java:55)\r\nE/neko.debug(29773): \tat java.lang.Class.getDexCacheType(Class.java:479)\r\nE/neko.debug(29773): \tat java.lang.reflect.ArtMethod.getDexCacheType(ArtMethod.java:191)\r\nE/neko.debug(29773): \tat java.lang.reflect.ArtMethod.getParameterTypes(ArtMethod.java:136)\r\nE/neko.debug(29773): \tat java.lang.reflect.Method.getParameterTypes(Method.java:174)\r\nE/neko.debug(29773): \tat java.lang.reflect.Method$1.compare(Method.java:60)\r\nE/neko.debug(29773): \tat java.lang.reflect.Method$1.compare(Method.java:53)\r\nE/neko.debug(29773): \tat java.util.TimSort.mergeHi(TimSort.java:802)\r\nE/neko.debug(29773): \tat java.util.TimSort.mergeAt(TimSort.java:481)\r\nE/neko.debug(29773): \tat java.util.TimSort.mergeForceCollapse(TimSort.java:422)\r\nE/neko.debug(29773): \tat java.util.TimSort.sort(TimSort.java:219)\r\nE/neko.debug(29773): \tat java.util.TimSort.sort(TimSort.java:169)\r\nE/neko.debug(29773): \tat java.util.Arrays.sort(Arrays.java:2010)\r\nE/neko.debug(29773): \tat java.util.Collections.sort(Collections.java:1883)\r\nE/neko.debug(29773): \tat libcore.util.CollectionUtils.removeDuplicates(CollectionUtils.java:86)\r\nE/neko.debug(29773): \tat java.lang.Class.getMethods(Class.java:830)\r\nE/neko.debug(29773): \tat clojure.lang.Reflector.getMethods(Reflector.java:373)\r\nE/neko.debug(29773): \tat clojure.lang.Reflector.invokeInstanceMethod(Reflector.java:27)\r\nE/neko.debug(29773): \tat org.example.coaproblem.main$MainActivity_onCreate$fn__1725.invoke(main.clj:24)\r\nE/neko.debug(29773): \tat neko.listeners.view$on_click_call$reify__1201.onClick(view.clj:26)\r\nE/neko.debug(29773): \tat android.view.View.performClick(View.java:4789)\r\nE/neko.debug(29773): \tat android.view.View$PerformClick.run(View.java:19881)\r\nE/neko.debug(29773): \tat android.os.Handler.handleCallback(Handler.java:739)\r\nE/neko.debug(29773): \tat android.os.Handler.dispatchMessage(Handler.java:95)\r\nE/neko.debug(29773): \tat android.os.Looper.loop(Looper.java:135)\r\nE/neko.debug(29773): \tat android.app.ActivityThread.main(ActivityThread.java:5294)\r\nE/neko.debug(29773): \tat java.lang.reflect.Method.invoke(Native Method)\r\nE/neko.debug(29773): \tat java.lang.reflect.Method.invoke(Method.java:372)\r\nE/neko.debug(29773): \tat com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:904)\r\nE/neko.debug(29773): \tat com.android.internal.os.ZygoteInit.main(ZygoteInit.java:699)\r\nE/neko.debug(29773): Caused by: java.lang.ClassNotFoundException: Didn't find class \"android.view.SearchEvent\" on path: DexPathList[[zip file \"/data/app/org.example.coaproblem.debug-2/base.apk\"],nativeLibraryDirectories=[/vendor/lib, /system/lib]]\r\nE/neko.debug(29773): \tat dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)\r\nE/neko.debug(29773): \tat java.lang.ClassLoader.loadClass(ClassLoader.java:511)\r\nE/neko.debug(29773): \tat java.lang.ClassLoader.loadClass(ClassLoader.java:469)\r\nE/neko.debug(29773): \tat libcore.reflect.InternalNames.getClass(InternalNames.java:53)\r\nE/neko.debug(29773): \t... 29 more\r\nE/neko.debug(29773): \tSuppressed: java.lang.ClassNotFoundException: android.view.SearchEvent\r\nE/neko.debug(29773): \t\tat java.lang.Class.classForName(Native Method)\r\nE/neko.debug(29773): \t\tat java.lang.BootClassLoader.findClass(ClassLoader.java:781)\r\nE/neko.debug(29773): \t\tat java.lang.BootClassLoader.loadClass(ClassLoader.java:841)\r\nE/neko.debug(29773): \t\tat java.lang.ClassLoader.loadClass(ClassLoader.java:504)\r\nE/neko.debug(29773): \t\t... 31 more\r\nE/neko.debug(29773): \tCaused by: java.lang.NoClassDefFoundError: Class not found using the boot class loader; no stack available\r\n\r\nNotes:\r\n\r\n-lein droid is 0.4.3\r\n\r\n-AndroidManifest.template.xml indicates:\r\n\r\n   <uses-sdk android:minSdkVersion=\"15\" \r\n             android:targetSdkVersion=\"{{target-version}}\" />\r\n\r\n-Changing :target-sdk to \"22\" in project.clj and following subsequent steps does not \r\n result in an exception.\r\n"},"comment":{"url":"https://api.github.com/repos/clojure-android/lein-droid/issues/comments/200148734","html_url":"https://github.com/clojure-android/lein-droid/issues/148#issuecomment-200148734","issue_url":"https://api.github.com/repos/clojure-android/lein-droid/issues/148","id":200148734,"user":{"login":"fnd009","id":1651997,"avatar_url":"https://avatars.githubusercontent.com/u/1651997?v=3","gravatar_id":"","url":"https://api.github.com/users/fnd009","html_url":"https://github.com/fnd009","followers_url":"https://api.github.com/users/fnd009/followers","following_url":"https://api.github.com/users/fnd009/following{/other_user}","gists_url":"https://api.github.com/users/fnd009/gists{/gist_id}","starred_url":"https://api.github.com/users/fnd009/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fnd009/subscriptions","organizations_url":"https://api.github.com/users/fnd009/orgs","repos_url":"https://api.github.com/users/fnd009/repos","events_url":"https://api.github.com/users/fnd009/events{/privacy}","received_events_url":"https://api.github.com/users/fnd009/received_events","type":"User","site_admin":false},"created_at":"2016-03-23T03:21:41Z","updated_at":"2016-03-23T03:21:41Z","body":"Hi, i had this issue before and the workaround is to create manually a SearchEvent class.\r\n\r\n`cd your-project-path`\r\n`mkdir -p src/java/android/view`\r\n`touch src/java/android/view/SearchEvent.java`\r\n\r\nAnd put the code as in https://android.googlesource.com/platform/frameworks/base/+/master/core/java/android/view/SearchEvent.java in the just created SearchEvent.java file. Then rebuild (lein droid doall) your project.\r\n\r\nLet me know if there is other solution. Thank you."}}