I have defined two classes for a java program I am writing, call them Class1 and Class2. In the body of the constructor for Class1, I call the constructor for class 2. Howev
I had the same issue and the solution was very simple in my case.
The case:
I copy/paste some classes from another project in a package of the project I am working in.
Some of them had the old package declaration and the compiler didn't complained (for his reasons).
When I used a method with return type one of the 'wrong packaged' classes this error appeared.
(The Type of is erroneous)
The solution
To solve the issue, I changed the package declaration to be the correct one!