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

查看:80
本文介绍了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//data/checkouts/ 的完整路径,发现我不再看到重复项.

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项目的时候没有遇到过这个问题,只能想象可能与使用IntelliJ的Gradle插件有关.

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天全站免登陆