Closed jeffdcamp closed 9 years ago
I'm seeing this issue as well :-\
I am getting the same results with my dialogs.
It seems that this might be a AppCompat issue... there seems to be similar discussions about this same issue with other annotation processing libraries:
https://github.com/excilys/androidannotations/issues/1435
and
I just found a TEMPORARY workaround... till appcompat fixes this issue:
android.support.v4.app
DialogFragment$DialogStyle.java
// todo remove this file when fixed in appcompat (https://code.google.com/p/android/issues/detail?id=175086) public @interface DialogFragment$DialogStyle { }
@jeffdcamp You're proposed solution doesn't seem to work for me I now get the following error:
An exception has occurred in the compiler (1.8.0_40). Please file a bug at the Java Developer Connection (http://java.sun.com/webapps/bugreport) after checking the Bug Parade for duplicates. Include your program and the following diagnostic in your report. Thank you. java.lang.NullPointerException at com.sun.tools.javac.code.Types.eraseNotNeeded(Types.java:2178) at com.sun.tools.javac.code.Types.erasure(Types.java:2171) at com.sun.tools.javac.comp.TransTypes.erasure(TransTypes.java:867) at com.sun.tools.javac.comp.TransTypes.translateClass(TransTypes.java:1018) at com.sun.tools.javac.comp.TransTypes.visitClassDef(TransTypes.java:511) at com.sun.tools.javac.tree.JCTree$JCClassDecl.accept(JCTree.java:693) at com.sun.tools.javac.tree.TreeTranslator.translate(TreeTranslator.java:58) at com.sun.tools.javac.comp.TransTypes.translate(TransTypes.java:490) at com.sun.tools.javac.comp.TransTypes.translateTopLevelClass(TransTypes.java:1035) at com.sun.tools.javac.main.JavaCompiler.desugar(JavaCompiler.java:1486) at com.sun.tools.javac.main.JavaCompiler.desugar(JavaCompiler.java:1356) at com.sun.tools.javac.main.JavaCompiler.compile2(JavaCompiler.java:901) at com.sun.tools.javac.main.JavaCompiler.compile(JavaCompiler.java:860) at com.sun.tools.javac.main.Main.compile(Main.java:523)
@marcoRS Interesting.... I have applied this work-around to 4 different projects and verified that these projects compile correctly on several machines... I compile with java 8 on one machine and java 7 on another machine....
Same issue with @jeffdcamp Is updating jre etc helpful?
Getting the same error as @marcoRS
+1. Got the same error as @marcoRS
same error as @marcoRS
@marcoRS, @RobertoArtiles, @malroy89 , @AlexanderThiele I found another work-around.... a bit more ugly... but has gotten us around this issue (including the NPE on the above work-around) till appcompat 22.2 is fixed.
android.support.v4.app
@jeffdcamp Thanks for the workaround. I however had to change every class that extended from DialogFragment, not just the classes that used @Inject
It was fixed on Android Support 22.2.1.
Fixed
I don't know if this is an issue with Dagger 2.0 or Android AppCompat....
We are using android.support.v4.app.DialogFragment and Dagger 2. When switching from appcompat-v7:22.1.0 to appcompat-v7:22.2.0 Dagger annotation processor causes the following error:
===== Gradle log ===== :processDebugJavaRes UP-TO-DATE :compileDebugJavaWithJavac error: cannot access DialogStyle class file for android.support.v4.app.DialogFragment$DialogStyle not found Consult the following stack trace for details. com.sun.tools.javac.code.Symbol$CompletionFailure: class file for android.support.v4.app.DialogFragment$DialogStyle not found 1 error :compileDebugJavaWithJavac FAILED
Very Simple Sample Code which causes the error:
===== TestFragment.java ===== import android.support.v4.app.DialogFragment; import org.company.project.Prefs; import javax.inject.Inject;
public class TestFragment extends DialogFragment { @Inject Prefs prefs; }
===== AppComponent.java ===== import org.company.project.ui.TestFragment; import javax.inject.Singleton; import dagger.Component;
@Singleton @Component(modules = AppModule.class) public interface AppComponent { void inject(TestFragment target); }