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

generateDaggerFactories doesn't seem to work on windows (?) #75

Closed
ursusursus opened this issue Aug 28, 2020 · 4 comments · Fixed by #78
Closed

generateDaggerFactories doesn't seem to work on windows (?) #75

ursusursus opened this issue Aug 28, 2020 · 4 comments · Fixed by #78
Assignees
Labels
bug Something isn't working dagger factory Happens when generateDaggerFactories is set to true

Comments

@ursusursus
Copy link

ursusursus commented Aug 28, 2020

https://github.com/ursusursus/AnvilRepro

:base contains the flag, and has removed the dagger compiler, and kapt altogether
dagger compiler and kapt is still present in :app

I think this is the correct usage, and therefore a bug in the library

> Task :base:compileDebugKotlin FAILED
e: C:\Users\ursus\AndroidStudioProjects\MyApplication9\base\build\anvil\src-gen-compileDebugKotlin\sk\foo\base\di\BaseModule_BarFactory.kt: (8, 14): Unresolved reference: annotation
e: C:\Users\ursus\AndroidStudioProjects\MyApplication9\base\build\anvil\src-gen-compileDebugKotlin\sk\foo\base\di\BaseModule_BarFactory.kt: (16, 2): Unresolved reference: Generated

In my real project I kept getting

error: incompatible types: NonExistentClass cannot be converted to Annotation` 

on a similar setup

@vRallev vRallev self-assigned this Aug 28, 2020
@vRallev vRallev added the bug Something isn't working label Aug 28, 2020
@vRallev
Copy link
Collaborator

vRallev commented Aug 28, 2020

The problem is the language level and the @Generated annotation. Maybe I'll remove it altogether.

@ursusursus
Copy link
Author

How, not targeting java 8 in the sample? Because I do target it in the real project

@vRallev
Copy link
Collaborator

vRallev commented Aug 28, 2020

I think you need to add the dependency javax.annotation:jsr250-api:1.0.

@ursusursus
Copy link
Author

ursusursus commented Aug 28, 2020

Yep, adding that fixes both the repro and the real project. Wondering who puts it on the classpath in your project

@vRallev vRallev added the dagger factory Happens when generateDaggerFactories is set to true label Aug 30, 2020
vRallev added a commit that referenced this issue Aug 31, 2020
…. The @generated annotation changed

between different JDK versions and might not always be present. Avoid the hassle of resolving the annotation
and simply use a comment.

Fixes #75
vRallev added a commit that referenced this issue Aug 31, 2020
…. The @generated annotation changed

between different JDK versions and might not always be present. Avoid the hassle of resolving the annotation
and simply use a comment.

Fixes #75
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working dagger factory Happens when generateDaggerFactories is set to true
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants