Android Studio无法创建新的Android项目。

时间:2022-05-19 20:43:41

I'm using the most recent Android Studio and today my Mac crashed. After rebooting, I opened Android Studio and now all of my projects are erroring out with the Android URI not being found. They won't build, won't make, nothing. If I create a new Project, Android project is not one of my options, just all the rest of the options. Is there anything I can do besides remove and reinstall?

我正在使用最新的Android Studio,今天我的Mac崩溃了。重启后,我打开了Android Studio,现在我所有的项目都没有找到Android的URI。他们不会建造,不会制造,什么都没有。如果我创建一个新项目,Android项目不是我的选择之一,只是所有其他的选项。除了删除和重新安装之外,我还能做什么?

6 个解决方案

#1


1  

I'd recommend you do a uninstall of Android Studio and then do a clean install. It might be that there are corrupted or locked system files that are causing the issue. Make sure you backup your Android projects onto a USB first - just in case.

我建议您先卸载Android Studio,然后再进行一次干净的安装。可能是有损坏或锁定的系统文件导致了这个问题。确保你先把你的Android项目备份到USB上——以防万一。

#2


11  

I recommend you to Reset your Android Studio instead of fresh installation(At least give a try).

我建议您重新设置您的Android Studio,而不是重新安装(至少尝试一下)。

On Windows:

在Windows上:

Go to your User Profile Folder - on Windows 7/8 this would be:

进入你的用户档案文件夹-在Windows 7/8这将是:

 [SYSDRIVE]:\Users\[your username] (ex. C:\Users\pyus13)

Inside this there will be a folder named .AndroidStudioPreview (It can be hidden so please check ).

在这里面会有一个名为. androidstudiopreview的文件夹(它可以隐藏,所以请检查)。

Delete this folder (Better to take a backup before deletion).

删除此文件夹(最好在删除前进行备份)。

This will reset your AS to defaults.

这将重置您的默认值。

Now Start your Android Studio you will see the start dialog with settings.

现在启动你的Android Studio,你会看到设置的开始对话框。

Do the following to set your Android sdk path :

按照以下步骤设置您的Android sdk路径:

 Go into Configure → Project Defaults → Project Structure → Project

Add new SDK and referencing to the SDK Folder that you have and then click apply and ok.

添加新的SDK并将其引用到所拥有的SDK文件夹中,然后单击apply和ok。

Try to open any of your earlier project or create new one and check. try syncing with Gradle after opening project.

尝试打开您以前的任何项目或创建一个新的项目并检查。打开项目后尝试与Gradle同步。

For Linux

Linux

Depending on your AndroidStudio version, the settings are stored in ~/.AndroidStudio, ~/.AndroidStudio1.1 or ~/.AndroidStudio1.2.

根据您的AndroidStudio版本,设置存储在~/中。AndroidStudio、~ / .AndroidStudio1.1或~ / .AndroidStudio1.2。

Open a terminal and run the following code:

打开终端,运行以下代码:

ls -a | grep Android # See which of those three folders above you have. Then rename each of the settings folders you have with the appropriate mv command:

看看你上面三个文件夹中的哪一个。然后用适当的mv命令重命名每个设置文件夹:

mv .AndroidStudio .AndroidStudio.bak
mv .AndroidStudio1.1 .AndroidStudio1.1.bak
mv .AndroidStudio1.2 .AndroidStudio1.2.bak

#3


6  

Go to preference > Plugins uncheck the plugins which appear in red colour and recheck it again. Do apply Now the issue will get resolved

转到偏好>插件取消检查插件出现在红色,并再次检查它。现在申请这个问题会解决吗

#4


1  

Resetting Android Studio worked for me!

重新设置Android Studio为我工作!

You can reset studio by deleting .AndroidStudio directory from Users directory.

可以通过从用户目录中删除. androidstudio目录来重置studio。

C:\Users\Abc\\.AndroidStudio

Thanks.

谢谢。

#5


1  

I have solved this problem for my latest android studio

我已经为我最新的android studio解决了这个问题。

Method I ( Unhide the AppData ) :-

1) Show your hidden files from view -> hidden items(check it) you will see hidden folders & files as light color.

1)显示你的隐藏文件从视图->隐藏项目(检查)你将看到隐藏文件夹和文件作为浅色。

2) Then go to C:\Users\john (instead of john, it should be your user name).

2)然后去C:\Users\john(而不是约翰,它应该是你的用户名)。

3) Right click on "AppData"

3)右键点击“AppData”

4) Just uncheck the Hidden box

4)不勾选隐藏的方框

5) Move "sdk" folder from C:\Users\john\AppData\Local\Android to C:\Users\varad\AppData

5)将“sdk”文件夹从C:\Users\john\AppData\Local\Android C:\Users\varad\AppData

6) Open android studio, goto Configure-> Project defaults ->Project structure

6)打开android studio, goto配置->项目默认->项目结构

7) update new path of SDK like C:\Users\john\AppData\sdk Restart Android Studio.

7)更新Android SDK像C:\Users\john\AppData\sdk重启工作室的新路径。

Method II ( Move your SDK to another location) :-

1) Move "sdk" folder from C:\Users\john\AppData\Local\Android to any folder you want.

1)“sdk”文件夹从C:\Users\john\AppData\Local\Android移到任何你想要的文件夹。

2) Then update the SDK path in Android Studio from goto Configure-> Project defaults ->Project structure

2)从goto配置->项目默认值->项目结构,更新Android Studio的SDK路径

3)Restart Android Studio.

3)重新启动Android工作室。

:-) Enjoy Android Development.

:-)喜欢安卓开发。

#6


0  

This morning I downloaded android studio 2.1, and tried to create new project unfortunately I can't create new project, and I found this post @pyus13 suggests that to reset android studio, but it can't solve this problem.

今天早上我下载了android studio 2.1,并尝试创建新的项目,不幸的是我不能创建新的项目,我发现这个post @pyus13建议重置android studio,但是它不能解决这个问题。

And I checked android sdk in \AppData\Local\Android\sdk, saw android-23 in platform folder, with my previous experience with eclipse it is ready for running. A couple of hour I found a way to solve this problem, I download android 6.0, api 23 (SDK platform) with android SDK Manager. Do again for creating new project, it is ok.

我在\AppData\Local\ android \sdk中查看了android sdk,在platform文件夹中看到了android-23,根据我之前使用eclipse的经验,它已经可以运行了。我花了两个小时找到了解决这个问题的方法,我用android SDK管理器下载了android 6.0, api 23 (SDK平台)。再次创建新项目,没有问题。

Thank

谢谢

#1


1  

I'd recommend you do a uninstall of Android Studio and then do a clean install. It might be that there are corrupted or locked system files that are causing the issue. Make sure you backup your Android projects onto a USB first - just in case.

我建议您先卸载Android Studio,然后再进行一次干净的安装。可能是有损坏或锁定的系统文件导致了这个问题。确保你先把你的Android项目备份到USB上——以防万一。

#2


11  

I recommend you to Reset your Android Studio instead of fresh installation(At least give a try).

我建议您重新设置您的Android Studio,而不是重新安装(至少尝试一下)。

On Windows:

在Windows上:

Go to your User Profile Folder - on Windows 7/8 this would be:

进入你的用户档案文件夹-在Windows 7/8这将是:

 [SYSDRIVE]:\Users\[your username] (ex. C:\Users\pyus13)

Inside this there will be a folder named .AndroidStudioPreview (It can be hidden so please check ).

在这里面会有一个名为. androidstudiopreview的文件夹(它可以隐藏,所以请检查)。

Delete this folder (Better to take a backup before deletion).

删除此文件夹(最好在删除前进行备份)。

This will reset your AS to defaults.

这将重置您的默认值。

Now Start your Android Studio you will see the start dialog with settings.

现在启动你的Android Studio,你会看到设置的开始对话框。

Do the following to set your Android sdk path :

按照以下步骤设置您的Android sdk路径:

 Go into Configure → Project Defaults → Project Structure → Project

Add new SDK and referencing to the SDK Folder that you have and then click apply and ok.

添加新的SDK并将其引用到所拥有的SDK文件夹中,然后单击apply和ok。

Try to open any of your earlier project or create new one and check. try syncing with Gradle after opening project.

尝试打开您以前的任何项目或创建一个新的项目并检查。打开项目后尝试与Gradle同步。

For Linux

Linux

Depending on your AndroidStudio version, the settings are stored in ~/.AndroidStudio, ~/.AndroidStudio1.1 or ~/.AndroidStudio1.2.

根据您的AndroidStudio版本,设置存储在~/中。AndroidStudio、~ / .AndroidStudio1.1或~ / .AndroidStudio1.2。

Open a terminal and run the following code:

打开终端,运行以下代码:

ls -a | grep Android # See which of those three folders above you have. Then rename each of the settings folders you have with the appropriate mv command:

看看你上面三个文件夹中的哪一个。然后用适当的mv命令重命名每个设置文件夹:

mv .AndroidStudio .AndroidStudio.bak
mv .AndroidStudio1.1 .AndroidStudio1.1.bak
mv .AndroidStudio1.2 .AndroidStudio1.2.bak

#3


6  

Go to preference > Plugins uncheck the plugins which appear in red colour and recheck it again. Do apply Now the issue will get resolved

转到偏好>插件取消检查插件出现在红色,并再次检查它。现在申请这个问题会解决吗

#4


1  

Resetting Android Studio worked for me!

重新设置Android Studio为我工作!

You can reset studio by deleting .AndroidStudio directory from Users directory.

可以通过从用户目录中删除. androidstudio目录来重置studio。

C:\Users\Abc\\.AndroidStudio

Thanks.

谢谢。

#5


1  

I have solved this problem for my latest android studio

我已经为我最新的android studio解决了这个问题。

Method I ( Unhide the AppData ) :-

1) Show your hidden files from view -> hidden items(check it) you will see hidden folders & files as light color.

1)显示你的隐藏文件从视图->隐藏项目(检查)你将看到隐藏文件夹和文件作为浅色。

2) Then go to C:\Users\john (instead of john, it should be your user name).

2)然后去C:\Users\john(而不是约翰,它应该是你的用户名)。

3) Right click on "AppData"

3)右键点击“AppData”

4) Just uncheck the Hidden box

4)不勾选隐藏的方框

5) Move "sdk" folder from C:\Users\john\AppData\Local\Android to C:\Users\varad\AppData

5)将“sdk”文件夹从C:\Users\john\AppData\Local\Android C:\Users\varad\AppData

6) Open android studio, goto Configure-> Project defaults ->Project structure

6)打开android studio, goto配置->项目默认->项目结构

7) update new path of SDK like C:\Users\john\AppData\sdk Restart Android Studio.

7)更新Android SDK像C:\Users\john\AppData\sdk重启工作室的新路径。

Method II ( Move your SDK to another location) :-

1) Move "sdk" folder from C:\Users\john\AppData\Local\Android to any folder you want.

1)“sdk”文件夹从C:\Users\john\AppData\Local\Android移到任何你想要的文件夹。

2) Then update the SDK path in Android Studio from goto Configure-> Project defaults ->Project structure

2)从goto配置->项目默认值->项目结构,更新Android Studio的SDK路径

3)Restart Android Studio.

3)重新启动Android工作室。

:-) Enjoy Android Development.

:-)喜欢安卓开发。

#6


0  

This morning I downloaded android studio 2.1, and tried to create new project unfortunately I can't create new project, and I found this post @pyus13 suggests that to reset android studio, but it can't solve this problem.

今天早上我下载了android studio 2.1,并尝试创建新的项目,不幸的是我不能创建新的项目,我发现这个post @pyus13建议重置android studio,但是它不能解决这个问题。

And I checked android sdk in \AppData\Local\Android\sdk, saw android-23 in platform folder, with my previous experience with eclipse it is ready for running. A couple of hour I found a way to solve this problem, I download android 6.0, api 23 (SDK platform) with android SDK Manager. Do again for creating new project, it is ok.

我在\AppData\Local\ android \sdk中查看了android sdk,在platform文件夹中看到了android-23,根据我之前使用eclipse的经验,它已经可以运行了。我花了两个小时找到了解决这个问题的方法,我用android SDK管理器下载了android 6.0, api 23 (SDK平台)。再次创建新项目,没有问题。

Thank

谢谢