intellij cannot resolve the symbols in target folder
Last updated
Was this helpful?
Last updated
Was this helpful?
In IntelliJ, find the folder that the generated code goes in. This is controlled by settings on the same dialog as where you set up the annotation processing. Right click on that folder, find "Mark Directory As" in the context menu, and choose "Generated Sources Root".
After doing this, IntelliJ will recognize and handle the generated classes normally. It will also give a compile warning that an output path intersects with a source root, but that's reasonably ignorable. I haven't been able to find a way to get rid of that warning without also leaving the generated classes unrecognized.
I'm encountering the same issue, but my generated folders for annotation processing do not have the Right Click "Mark Directory As" option because they are Excluded by default in Project Structure - > Modules. It is not possible for me to unmark them as Excluded or to mark them as anything else...
I would guess your generated code folder is actually a subfolder of what the exclusion marking is on. You can either change where your generated code goes through the annotation processing settings, or unmark the parent folder (you will then want to exclude each of its subfolders other than the one for generated code).