android studio新项目缺少文件夹

时间:2022-03-08 20:41:49

I have created a new project using the latest version of Android Studio (0.2.2), this is a fresh install of studio. When I am in the project explorer view, it fails to show me any folders for my project. I should see a root project folder, and within it the .idea, gradle, and module folders, but they are not showing.

我使用最新版本的Android Studio(0.2.2)创建了一个新项目,这是一个全新的工作室安装。当我在项目资源管理器视图中时,它无法向我显示我的项目的任何文件夹。我应该看到一个根项目文件夹,其中包含.idea,gradle和module文件夹,但它们没有显示。

Here is what I expect to see (taken from the sample project created on first boot):

这是我期望看到的(取自首次启动时创建的示例项目):

android studio新项目缺少文件夹

But here is what I see immediately after the project's creation:

但这是我在项目创建后立即看到的内容:

android studio新项目缺少文件夹

I cannot figure out how to expose my project's folders! I do not want to develop without the project explorer, it's simply too much of a hassle. Did I create the project incorrectly, or am I missing some not-so-obvious setting somewhere?

我无法弄清楚如何公开我的项目的文件夹!我不想在没有项目浏览器的情况下开发,这简直太麻烦了。我是否错误地创建了项目,或者我错过了一些不那么明显的设置?

Thanks.

谢谢。

8 个解决方案

#1


20  

The problem here is that I assumed android studio would create a module for the application. I assumed this because it asked me at the beginning for app name, module name, package, sdk info etc.

这里的问题是我假设android studio会为应用程序创建一个模块。我之所以这么认为是因为它在开头问我应用程序名称,模块名称,包,sdk信息等。

This assumption turned out to be false. You must create your first module manually through File > Project Structure. After that is done, the project explorer shows the files.

这个假设被证明是错误的。您必须通过“文件”>“项目结构”手动创建第一个模块。完成后,项目资源管理器显示文件。

#2


14  

  1. File -> Project Structure -> Modules
  2. 文件 - >项目结构 - >模块
  3. Add Button (Green plus button) click -> New Module Select
  4. 添加按钮(绿色加按钮)单击 - >新模块选择
  5. New Module window -> "Content root" change path button click to select "Project root file path"
  6. 新建模块窗口 - >“内容根”更改路径按钮单击以选择“项目根文件路径”
  7. Apply to change save and "OK" button exit.
  8. 应用更改保存并退出“确定”按钮。

android studio新项目缺少文件夹

#3


7  

In the project Explorer there is a drop down menu where you have selected project, now change it to project files.

在项目资源管理器中,有一个下拉菜单,您可以在其中选择项目,现在将其更改为项目文件。

I hope this will solve your problem. reply if it didn't.

我希望这能解决你的问题。回答,如果没有。

#4


1  

You have created a new gradle project not a new android project. Update your android studio tools to 0.2.3 - Go to Help menu - select check for update. then Update your android sdk tools, android support repository, android support library and android build tools using android sdk manager.

您已经创建了一个新的gradle项目而不是一个新的android项目。将您的android studio工具更新为0.2.3 - 转到“帮助”菜单 - 选择“检查更新”。然后使用android sdk manager更新你的android sdk工具,android支持库,android支持库和android构建工具。

android studio新项目缺少文件夹 And update some configuration in project structure. Go to File menu->project structure -> in projects tab select Android SDK as default sdk and in SDKs tab set correct path to updated android sdk.

并更新项目结构中的一些配置。转到文件菜单 - >项目结构 - >在项目选项卡中选择Android SDK作为默认sdk,在SDKs选项卡中设置更新的android sdk的正确路径。

Now restart android studio and try to create a new project and it should work fine.

现在重启android studio并尝试创建一个新项目,它应该工作正常。

#5


1  

(Noted for posterity) I had a similar issue come up recently, when importing an Eclipse android project. The issue was that the source folder wasn't added as such. I had to manually go into Project Structure -> Modules -> Sources and make sure that the "src" folder wasn't excluded and was marked a source folder.

(注意后人)我最近在导入Eclipse android项目时出现了类似的问题。问题是没有添加源文件夹。我不得不手动进入项目结构 - >模块 - >源,并确保没有排除“src”文件夹,并将其标记为源文件夹。

#6


0  

I had this exact same issue, there are some problem if you upgrade from 0.1.9 version to 0.2.0 in Windows.

我有这个完全相同的问题,如果你在Windows中从0.1.9版本升级到0.2.0有一些问题。

Android Studio 0.2.0 Release

Android Studio 0.2.0版本

The solution (which worked for me) was to completely uninstall Android Studio and reinstall the 0.2.0 version.

解决方案(对我有用)是完全卸载Android Studio并重新安装0.2.0版本。

#7


0  

I had the same problem today. Additionally, the IDE posted an "Assertion Error" into its event log.

我今天遇到了同样的问题。此外,IDE在其事件日志中发布了“断言错误”。

Downloading and reinstalling the preview version, then applying the patch to 0.2.6 worked for me.

下载并重新安装预览版本,然后将补丁应用到0.2.6对我有用。

#8


0  

Change the SDK to a level that you have installed in the SDK manager. The SDK manager can be accessed from Tools -> Android -> SDK Manager. For me, Android Studio was packaged with API Level 17 but the new project wizard tried to target API Level 18.

将SDK更改为您在SDK管理器中安装的级别。可以从Tools - > Android - > SDK Manager访问SDK管理器。对我来说,Android Studio打包了API Level 17,但新项目向导试图以API Level 18为目标。

#1


20  

The problem here is that I assumed android studio would create a module for the application. I assumed this because it asked me at the beginning for app name, module name, package, sdk info etc.

这里的问题是我假设android studio会为应用程序创建一个模块。我之所以这么认为是因为它在开头问我应用程序名称,模块名称,包,sdk信息等。

This assumption turned out to be false. You must create your first module manually through File > Project Structure. After that is done, the project explorer shows the files.

这个假设被证明是错误的。您必须通过“文件”>“项目结构”手动创建第一个模块。完成后,项目资源管理器显示文件。

#2


14  

  1. File -> Project Structure -> Modules
  2. 文件 - >项目结构 - >模块
  3. Add Button (Green plus button) click -> New Module Select
  4. 添加按钮(绿色加按钮)单击 - >新模块选择
  5. New Module window -> "Content root" change path button click to select "Project root file path"
  6. 新建模块窗口 - >“内容根”更改路径按钮单击以选择“项目根文件路径”
  7. Apply to change save and "OK" button exit.
  8. 应用更改保存并退出“确定”按钮。

android studio新项目缺少文件夹

#3


7  

In the project Explorer there is a drop down menu where you have selected project, now change it to project files.

在项目资源管理器中,有一个下拉菜单,您可以在其中选择项目,现在将其更改为项目文件。

I hope this will solve your problem. reply if it didn't.

我希望这能解决你的问题。回答,如果没有。

#4


1  

You have created a new gradle project not a new android project. Update your android studio tools to 0.2.3 - Go to Help menu - select check for update. then Update your android sdk tools, android support repository, android support library and android build tools using android sdk manager.

您已经创建了一个新的gradle项目而不是一个新的android项目。将您的android studio工具更新为0.2.3 - 转到“帮助”菜单 - 选择“检查更新”。然后使用android sdk manager更新你的android sdk工具,android支持库,android支持库和android构建工具。

android studio新项目缺少文件夹 And update some configuration in project structure. Go to File menu->project structure -> in projects tab select Android SDK as default sdk and in SDKs tab set correct path to updated android sdk.

并更新项目结构中的一些配置。转到文件菜单 - >项目结构 - >在项目选项卡中选择Android SDK作为默认sdk,在SDKs选项卡中设置更新的android sdk的正确路径。

Now restart android studio and try to create a new project and it should work fine.

现在重启android studio并尝试创建一个新项目,它应该工作正常。

#5


1  

(Noted for posterity) I had a similar issue come up recently, when importing an Eclipse android project. The issue was that the source folder wasn't added as such. I had to manually go into Project Structure -> Modules -> Sources and make sure that the "src" folder wasn't excluded and was marked a source folder.

(注意后人)我最近在导入Eclipse android项目时出现了类似的问题。问题是没有添加源文件夹。我不得不手动进入项目结构 - >模块 - >源,并确保没有排除“src”文件夹,并将其标记为源文件夹。

#6


0  

I had this exact same issue, there are some problem if you upgrade from 0.1.9 version to 0.2.0 in Windows.

我有这个完全相同的问题,如果你在Windows中从0.1.9版本升级到0.2.0有一些问题。

Android Studio 0.2.0 Release

Android Studio 0.2.0版本

The solution (which worked for me) was to completely uninstall Android Studio and reinstall the 0.2.0 version.

解决方案(对我有用)是完全卸载Android Studio并重新安装0.2.0版本。

#7


0  

I had the same problem today. Additionally, the IDE posted an "Assertion Error" into its event log.

我今天遇到了同样的问题。此外,IDE在其事件日志中发布了“断言错误”。

Downloading and reinstalling the preview version, then applying the patch to 0.2.6 worked for me.

下载并重新安装预览版本,然后将补丁应用到0.2.6对我有用。

#8


0  

Change the SDK to a level that you have installed in the SDK manager. The SDK manager can be accessed from Tools -> Android -> SDK Manager. For me, Android Studio was packaged with API Level 17 but the new project wizard tried to target API Level 18.

将SDK更改为您在SDK管理器中安装的级别。可以从Tools - > Android - > SDK Manager访问SDK管理器。对我来说,Android Studio打包了API Level 17,但新项目向导试图以API Level 18为目标。