Android Studio项目视图中的重复文件 [英] Duplicate files in Android Studio project view

查看:676
本文介绍了Android Studio项目视图中的重复文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个奇怪的问题,即项目特定的根级文件(.gitignore,gradlew,gradle.properties等)在Android Studio的项目视图中出现两次。有没有人知道如何解决这个问题?

I have a strange issue where project specific root level files (.gitignore, gradlew, gradle.properties, etc) show up twice in Android Studio's project view. Does anybody know how to fix this?

我尝试重新导入项目(删除.iml和.idea文件/文件夹后)。

I've tried re-importing the project (after deleting the .iml and .idea file/folder).

推荐答案

我最近在创建新的Gradle项目并导入IntelliJ时发现了完全相同的问题。但是,根本原因似乎是在导入项目时使用符号链接。

I found exactly the same problem recently when I created a new Gradle project and imported into IntelliJ. However, the root cause seems to be the use of symbolic links when importing the project.

我有以下符号链接:

/data -> /Users/<user>/data

当我最初导入项目时,我导入了 / data / checkouts /< project_dir> 但发现我的顶级目录中有重复文件,如上所示。

When I originally imported my project, I imported /data/checkouts/<project_dir> but found that I had duplicate files from the top level directory exactly like as shown above.

但是,我删除了项目并尝试再次导入它,这次使用 / Users /< user> / data / checkouts /< project_dir> 并发现我不再看到重复项。

However, I removed the project and attempted to import it again, this time using the full path of /Users/<user>/data/checkouts/<project_dir> and found that I no longer see the duplicates.

我在导入eclipse或Maven项目之前没有看到这个问题,所以只能想象它可能是与使用Gradle插件进行IntelliJ相关。

I haven't seen this problem before when importing an eclipse or Maven project, so can only imagine that it might be related to the use of the Gradle plugin for IntelliJ.

这篇关于Android Studio项目视图中的重复文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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