There is a project and its source code lies in main/java/example . There is also a code in the main/java/com folder. In com source code of the library.
Here, in the directory where R classes are created, the R class is created in the example folder, and the com folder does not appear with the R class. And it should, since the code has an import of this class. If to connect aar library through dependences this R class appears.
Well, I think I need to dig starting with the question:
At what point is the R class being created, maybe you need to add a record somewhere? So far I have just copied the R class that appears when the library is connected, but then it should appear as it is.
UPD
Copying the R class does not help, when you start the application, it is deleted. Why I need this class, I know very superficially, until I understand it and this is not the crux of the matter. I need an answer to how I create it. And I will deal with the meaning later
UPD1 On the way AndroidStudioProjects\app\src\main\java\example\i lay the code of my project. The library code was added along the path AndroidStudioProjects\app\src\main\java\com\vk\sdk . No matter what library it is. I tried to add different libraries, but the R class is created only for the code lying along the path AndroidStudioProjects\app\src\main\java\example\i And naturally swears at the absence of the import com.vk.sdk.R; class import com.vk.sdk.R; and everything like findViewById(R.id.captchaAnswer); highlighted in red, because no resource identifiers.
The UPD2 folder where the R classes appear is C:\Android\AndroidStudioProjects\AndroidStudioProjects\app\build\generated\source\r\debug If you hook up the library through dependencies, the R class will appear. I cut it. I disconnect dependences. I insert the cut class. But when you start the application, it is deleted. Those. where it is. An indication for which code the R class is created.
Cleaned the project, cache and rebuild tried.
UPD3 If we reformulate the question shorter, then R.class not created for other package that are in the src\main\java\ folder, except for the first package created