Android Studio Git克隆未正确显示文件

发布于 2025-02-01 14:30:44 字数 742 浏览 2 评论 0原文

我在项目中使用git遇到问题,我需要在两个设备上处理同一项目,但是我似乎无法在将项目克隆到的设备上工作。

这是项目结构在我的主设备中的外观,在我的主设备中创建了项目和存储库

href =“ https://i.sstatic.net/8a8p9.png” rel =“ nofollow noreferrer”>,这是我在次级设备中的外观a>

我尝试删除项目文件夹并再次克隆,从而删除.IDEA文件夹和重新启动(这使结构更加混乱),更改项目经理中的SDK,没有任何效用。

编辑:我尝试的更多内容:我安装了Gradle并执行了命令“ Gradle Init”和“ Gradle Tasks -All”终端中的命令,然后将项目与Gradle文件同步。仍然不起作用。

任何帮助将不胜感激。

编辑:找到解决方案,我挣扎着,解决方案非常愚蠢,我在Android Studio中打开了整个文件夹,而不仅仅是用Android Icon标记的项目。

像这样

这个问题有一个非常简单的解决方案,我希望这在将来对某人有帮助。

I'm having problems using git with my project, I need to work on the same project on my two devices, but I can't seem to make it work on the device where I'm cloning my project to.

Here's how the project structure looks in my main device, where the project and repository were created

And here's how it looks in my secondary device, I can't run anything and it doesn't detect java files

I've tried deleting the project folder and cloning again, deleting the .idea folder and restarting (which messed up even more the structure), changing the SDK in the project manager, and nothing worked.

Edit: More things I tried: I installed Gradle and executed the commands "gradle init" and "gradle tasks --all" in the terminal, then synced the project with gradle files. Still doesn't work.

Any help would be appreciated.

Edit: Found the solution, I struggled and the solution was very stupid, I was opening the whole folder in Android Studio instead of only the project marked with the android icon.

Like this

The problem had a very simple solution, and I hope this helps someone in the future.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文