Two modules in a project cannot share the same content root
Hello
for hour or so I am fighting against:
Content root "C:\Work\Projects\XXXX\Tausch-apk\target\generated-sources\r" is defined for modules "Noser-apklib" and "Remote-apklib". Two modules in a project cannot share the same content root.
So exuse me venting some steam:
- Please: SAVE IT ANYWAY!! — Why, oh why can´t I save an intermediate backup??? It is nice to know there is a bug, but I might want to save it anyway and come back to problem later. I am a proffeisonal software developer: I might fix it by opening the IML file in a text editor.
- I fixed it. I deleted all the offending content roots. I double and tripple checked. They are gone!
- Last note least: It was not me in the first case. The b**dy Android plugin is adding those faulty content roots. Don't do that. If I wanted them I can add them myself. But I don't: I use a singe content root all the time. I would not deam of doing anything else.
Resume: Another case of a tool trying to assist where no assistence is needed or wanted and it is going horrible wrong in the end. And now I need to click «Cancel» — loose all the other good changes and fix in the IML anyway.
Regards
Martin
请先登录再写评论。
I begin to wonder if this is a bug and not just nasty usability. It seems that IDEA does not noticen when I delete a content root and just continues to report an allready fixed problem
Martin
What is the project "XXXX"? Do you have different Maven project for these two modules? We add "<PROJECT_TARGET_DIR>/generated-sources/r" as a source root automatically
It is the customer name which I can not tell yet. The Project consists of several Libraries modules, an app module and an instrumentation test module — all of which have seperate Maven modules.
The problem is that the automated maven import often (but not allways) sets the “target/generated-sources/r” and several other directorys relativ to the IML file instead of the POM file. But since we develop on Mac OS X and Window we like to keep the IML files seperate from the source code. The is an appropiate option on the import dialog for that. Here a directory list of what it look like from another project (where the name is not a secret):
As you see all the IML files are added to the same directory if the this option is used.
Martin
PS: Don't look to close at the path names of the original post — they have been take after an hour of repair (including some copy paste mistakes) and don't represent the original state of affairs. If you wan't to repair the automated import then check that all generated path names are relativ to the POM file.
PPS: For me it would be enough if the maven / android import would not add any content roots — the rest I can fix manualy.