Search code examples
androiddaggerbutterknife

Dagger + ButterKnife = Could not initialize class dagger.internal.codegen.ModuleAdapterProcessor


I have a project where I'm using ButterKnife for view injection, and I just added dagger but I'm getting the following error:

Description Resource Path Location Type Internal compiler error: java.lang.NoClassDefFoundError: Could not initialize class dagger.internal.codegen.ModuleAdapterProcessor at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) R.java /Suggest/gen/com/google/android/gms line 0 Java Problem

I'm using eclipse and I have the following in my Annotation config:

enter image description here

notice: I have written one @module with its @provides ... correctly, then removed it and still I'm having the same compilation error

I followed this comment to setup Annotation processing:

https://github.com/square/dagger/issues/126#issuecomment-11992320

I'm not sure if it's code-related or dependency and versions related, I just need someone to point me to the possibilities behind this error


Solution

  • For those looking for a solution, I just found out that using JavaWriter 2.1.1 Fixed the problem