重复类R&安培; BuildConfig后"重新导入所有的Maven项目" [英] Duplicate classes R & BuildConfig after "Reimport All Maven Projects"

查看:1039
本文介绍了重复类R&安培; BuildConfig后"重新导入所有的Maven项目"的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们正在建设我们的Andr​​oid项目,Maven和IntelliJ IDEA的。有时候,我们必须执行重新导入所有Maven项目,如:更新依赖关系。这问题是,它总是食堂了对资源的源文件夹:所有模块得到根和目标/生成的源/ R,这似乎是值得重复的。所以重新导入后,我们需要手动删除其中的一个(通常是根文件夹)。当然,我们要避免这一步。我们尝试了几种设置为Android方面,但至今没有运气。

We are building our Android projects with Maven and IntelliJ IDEA. Sometimes we must execute "Reimport All Maven Projects", e.g. to update dependencies. The problem with that is that it always messes up the source folders for resources: all modules get "gen" and "target/generated-source/r" which seems to be the cause for the duplicates. So after reimporting, we need to manually delete one of those (usually the "gen" folder). Of course, we want to avoid this step. We tried several settings for the Android facet, but no luck so far.

那么,我们该如何配置的IntelliJ做一个适当的Maven重新导入,只是工作的?

So, how can we configure IntelliJ to do a proper Maven reimport that just works?

推荐答案

据斯文Strohschein处的 http://youtrack.jetbrains.com/issue/IDEA-94901 你可以尝试:

According to the reply of Sven Strohschein at http://youtrack.jetbrains.com/issue/IDEA-94901 you can try to:

  1. 删除根,目标和出的文件夹
  2. 还原中的知识产权
  3. 的修改和IML文件(或只是将它们全部删除,甚至.idea文件夹)
  4. 在开始的IntelliJ 12
  5. 打开POM文件
  6. 右键单击 - >Maven的 - >重新导入
  7. 在生成 - >重建工程
  1. Delete the "gen", "target" and "out" folders
  2. Revert the changes within the "ipr" and "iml" files (or just delete them all, maybe even .idea folder)
  3. Start IntelliJ 12
  4. Open the pom file
  5. Right click -> "Maven" -> "Reimport"
  6. "Build" -> "Rebuild project"

作品FO我。

这篇关于重复类R&安培; BuildConfig后"重新导入所有的Maven项目"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆