Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using Icepick without Annotation Processing? #81

mazurio opened this issue Mar 23, 2016 · 4 comments

Using Icepick without Annotation Processing? #81

mazurio opened this issue Mar 23, 2016 · 4 comments


Copy link

mazurio commented Mar 23, 2016


Is it possible to use Icepick without "@State" annotations? Can I manually add the objects I want to save? I would like to use Icepick with Kotlin but I cannot get it to work.


Copy link

I'd love to use kotlin too, but when you have Icepick

a simple class as

abstract class BaseFragment : Fragment() {

    override fun onCreateView(inflater: LayoutInflater?, container: ViewGroup?, savedInstanceState: Bundle?): View? {
        return super.onCreateView(inflater, container, savedInstanceState)


fails to compile because of icepick processor.

13:46:45.179 [ERROR] [org.gradle.BuildExceptionReporter] Caused by: java.lang.IllegalArgumentException: (android.view.LayoutInflater,android.view.ViewGroup,android.os.Bundle)android.view.View
13:46:45.179 [ERROR] [org.gradle.BuildExceptionReporter]    at
13:46:45.179 [ERROR] [org.gradle.BuildExceptionReporter]    at
13:46:45.179 [ERROR] [org.gradle.BuildExceptionReporter]    at clojure.lang.Reflector.invokeMatchingMethod(
13:46:45.179 [ERROR] [org.gradle.BuildExceptionReporter]    at clojure.lang.Reflector.invokeInstanceMethod(
13:46:45.179 [ERROR] [org.gradle.BuildExceptionReporter]    at icepick.processor$assignable_QMARK_.invoke(processor.clj:38)
13:46:45.179 [ERROR] [org.gradle.BuildExceptionReporter]    at icepick.processor$parcelable_QMARK_.invoke(processor.clj:220)
13:46:45.179 [ERROR] [org.gradle.BuildExceptionReporter]    at icepick.processor$bundle_method.invoke(processor.clj:239)
13:46:45.180 [ERROR] [org.gradle.BuildExceptionReporter]    at icepick.processor$analyze_field.invoke(processor.clj:259)
13:46:45.180 [ERROR] [org.gradle.BuildExceptionReporter]    at clojure.core$map$fn__4553.invoke(core.clj:2624)
13:46:45.180 [ERROR] [org.gradle.BuildExceptionReporter]    at clojure.lang.LazySeq.sval(
13:46:45.180 [ERROR] [org.gradle.BuildExceptionReporter]    at clojure.lang.LazySeq.seq(
13:46:45.180 [ERROR] [org.gradle.BuildExceptionReporter]    at clojure.lang.RT.seq(
13:46:45.180 [ERROR] [org.gradle.BuildExceptionReporter]    at clojure.core$seq__4128.invoke(core.clj:137)
13:46:45.180 [ERROR] [org.gradle.BuildExceptionReporter]    at clojure.core.protocols$seq_reduce.invoke(protocols.clj:30)
13:46:45.180 [ERROR] [org.gradle.BuildExceptionReporter]    at clojure.core.protocols$fn__6506.invoke(protocols.clj:101)
13:46:45.180 [ERROR] [org.gradle.BuildExceptionReporter]    at clojure.core.protocols$fn__6452$G__6447__6465.invoke(protocols.clj:13)
13:46:45.180 [ERROR] [org.gradle.BuildExceptionReporter]    at clojure.core$reduce.invoke(core.clj:6519)
13:46:45.180 [ERROR] [org.gradle.BuildExceptionReporter]    at clojure.core$group_by.invoke(core.clj:6861)
13:46:45.180 [ERROR] [org.gradle.BuildExceptionReporter]    at icepick.processor$process.invoke(processor.clj:275)
13:46:45.180 [ERROR] [org.gradle.BuildExceptionReporter]    at clojure.lang.Var.invoke(
13:46:45.180 [ERROR] [org.gradle.BuildExceptionReporter]    at icepick.processor.IcepickProcessor.process(
13:46:45.180 [ERROR] [org.gradle.BuildExceptionReporter]    at org.jetbrains.kotlin.annotation.AnnotationProcessorWrapper.process(AnnotationProcessorWrapper.kt:115)
13:46:45.180 [ERROR] [org.gradle.BuildExceptionReporter]    at
13:46:45.180 [ERROR] [org.gradle.BuildExceptionReporter]    at
13:46:45.180 [ERROR] [org.gradle.BuildExceptionReporter]    at$1800(
13:46:45.180 [ERROR] [org.gradle.BuildExceptionReporter]    at$
13:46:45.180 [ERROR] [org.gradle.BuildExceptionReporter]    at
13:46:45.180 [ERROR] [org.gradle.BuildExceptionReporter]    at
13:46:45.180 [ERROR] [org.gradle.BuildExceptionReporter]    at
13:46:45.181 [ERROR] [org.gradle.BuildExceptionReporter]    at
13:46:45.181 [ERROR] [org.gradle.BuildExceptionReporter]    ... 91 more

not really sure tough if it's the kotlin processor or icepick.

Copy link

tinsukE commented Aug 19, 2016

If you're not a fan of exposing your variables and using @JvmField, I've started a simple lib that should work as Icepick:
Contributions are welcome!

Copy link

@tinsukE your lib works great! Thanks man!

Copy link

vRallev commented Jan 26, 2017

And here's another alternative. Same API like Icepick, but works well with properties:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
None yet

No branches or pull requests

5 participants