This issue happened when the Java project has some protobuf definition file and the corresponding generated Java class could not be found in the Java classes, even the whole project could be compiled properly by “gradle clean build” command. The root cause was that, the IDE(IntelliJ IDEA) could not find the Java source code generated by the protobuf compiler althouhg the Java source code was generated already.
The solution is simple. Go to “File -> Project Structure -> Project Settings -> Modules”, in the existing default module, select “main”, click the “+ Add Content Root” link. In the pop-up file selector window, select the “