Android Studio 无法创建新的 Android 项目
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/20940665/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Android Studio Can't Create new Android Project
提问by TheRedAgent
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 项目不是我的选项之一,而是所有其他选项。除了删除并重新安装之外,我还能做些什么吗?
采纳答案by robnick
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 上 - 以防万一。
回答by pyus13
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.
这会将您的 AS 重置为默认值。
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 文件夹,然后单击应用并确定。
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 or ~/.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:
ls -a | grep Android
# 看看你有上面三个文件夹中的哪一个。然后使用适当的 mv 命令重命名您拥有的每个设置文件夹:
mv .AndroidStudio .AndroidStudio.bak
mv .AndroidStudio1.1 .AndroidStudio1.1.bak
mv .AndroidStudio1.2 .AndroidStudio1.2.bak
回答by Jerin Jose
Go to preference > Plugins uncheck the plugins which appear in red colour and recheck it again. Do apply Now the issue will get resolved
转到首选项 > 插件取消选中以红色显示的插件,然后再次重新选中。申请 现在问题将得到解决
回答by Sujit Devkar
Resetting Android Studio worked for me!
重置 Android Studio 对我有用!
You can reset studio by deleting .AndroidStudio directory from Users directory.
您可以通过从用户目录中删除 .AndroidStudio 目录来重置工作室。
C:\Users\Abc\.AndroidStudio
Thanks.
谢谢。
回答by Mahmoud Saad
I go this path:
我走这条路:
C:\Users\...YOUR-USER-NAME...\.AndroidStudio3.2\config\disabled_plugins.txt
remove this line:
删除这一行:
org.jetbrains.android
then refresh SDK in settings. Works fine now :)
然后在设置中刷新SDK。现在工作正常:)
回答by varad lanke
I have solved this problem for my latest android studio
我已经为我最新的 android studio 解决了这个问题
Method I ( Unhide the AppData ) :-
方法 I(取消隐藏 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(而不是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,进入Configure->Project defaults->Project structure
7) update new path of SDK like C:\Users\john\AppData\sdk Restart Android Studio.
7) 更新 SDK 的新路径,如 C:\Users\john\AppData\sdk 重新启动 Android Studio。
Method II ( Move your SDK to another location) :-
方法二(将您的 SDK 移动到另一个位置):-
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)然后更新Android Studio中的SDK路径,从goto Configure-> Project defaults ->Project structure
3)Restart Android Studio.
3)重启Android Studio。
:-) Enjoy Android Development.
:-) 享受安卓开发。
回答by SAWAUNG
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,并尝试创建新项目,不幸的是我无法创建新项目,我发现这篇@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,在平台文件夹中看到了 android-23,根据我之前使用 eclipse 的经验,它已准备好运行。几个小时后,我找到了解决此问题的方法,我使用 android SDK Manager 下载了 android 6.0、api 23(SDK 平台)。创建新项目再做一次,就可以了。
Thank
谢谢