android studio can not open - performance

when I click on the android studio icon cannot open and show error.
I change the setting of the android studio from click Help > Edit Custom VM Options to open your studio.vmoptions file and write
XmxheapSize-Xmx2g
After than android studio show that error and can not open.

Press Start, type Path, and click Enter to select Edit environment variables for your account.
You will see Environment Variables.. option in System Properties panel, click that.
In System Variables part click new and in Variable name part type JAVA_HOME
and in Variable value part you should copy and paste the path of your JDK and then press Ok and restart your system. look at the images for better understanding:
I hope this solves your problem.

Related

My flutter android studio terminal doesn't work

If I write something such as flutter doctor inside the terminal, it saids ('flutter' is not recognized as an internal or external command, operable program or batch file.)and it doesn't work.Is there a specific place you should put the flutter file? Is there something you should add in the Enviroment variables?
(Im using a window 10)
Yes you need to add flutter to your environment path
On the Windows desktop, right-click My Computer.
In the pop-up menu, click Properties.
In the System Properties window, click the Advanced tab, and then click Environment Variables.
In the System Variables window, edit Path;
Add your <Flutter_Path>/bin
Restart your IDE and try again.
Because you are missing the PATH variables.
Follow these steps:
In Search, search for and then select: System (Control Panel)
Click the Advanced system settings link.
Click Environment Variables. In the section System Variables, find the PATH environment variable and select it. Click Edit.
In the Edit System Variable window, add C:\Windows\System32
separated by a ;. Click OK. Close all remaining windows by clicking
OK.
Restart your computer.
Now run flutter doctor

Changing the default path of Visual Studio Code's integrated terminal

I'm trying to change the default path of the integrated terminal in Visual Studio Code, but I'm not sure how to. I do know how to change it in the windows command prompt, but not in Visual Studio Code. I looked in user settings, but I can't find anything there to change.
The current default path is C:\Users\User_Name.
I'd like to change it to C:\Project.
How do I do this in Visual Studio Code?
Short answer
Edit the user preference "terminal.integrated.cwd": "" to the path that you want the integrated terminal to open to.
Long answer
The same answer, but the long step-by-step version,
In Visual Studio Code go to:
Menu File → Preferences → Settings
Now that you are in the "User Settings", using the "Search Settings" bar across the top of the window paste or type this:
terminal.integrated.cwd
It will list the following as a result:
// An explicit start path where the terminal will be launched, this is used
as the current working directory (cwd) for the shell process. This may be
particularly useful in workspace settings if the root directory is not a
convenient cwd.
"terminal.integrated.cwd": "",
You will notice that it will not let you type here to change this setting. That is because you can't change the default setting. You instead need to change your personal settings. Here's how...
Click the pencil icon to the left of the this option and then the "Copy to Settings" option that pops-up.
You should have a split screen in which the right side of the screen has the heading Place your settings here to overwrite the Default Settings. This is the correct place for you to make changes. You might already have a few personalized settings listed here.
When you clicked "Copy to Settings" it automatically added this line for you:
"terminal.integrated.cwd": ""
Notice that whichever item is last in this list will not have a trailing comma but any items before it in the list will require one.
FYI: you could have simply typed or copy/pasted this into the personalized settings yourself, but following these steps is the process to learn for changing other preferences as needed.
Now you are able to type to set the path you want to use. Make sure to use \\ in place of \ and you do not need the trailing \. For example including this line would always start your terminal in the baz directory:
{
"terminal.integrated.cwd": "C:\\Users\\foo\\bar\\baz"
}
To apply the change, simply Save and restart Visual Studio Code.
As others have already explained, you can add a setting to change the default folder for your integrated terminal to start in. This setting also accepts Visual Studio Code variables, so to make a relative path from the root folder of your workspace you can use ${workspaceFolder}.
For example, for your terminal to always start in the subfolder mystart, your setting would be:
"terminal.integrated.cwd": "${workspaceFolder}/mystart"
Thanks for the original answer from Peter. Definitely helped !
It has now slightly changed in more recent versions of VS Code.
Navigate to File -> Preferences -> Settings
Type cwd in search
Choose Terminal > Integrated: Cwd settings
Type the default path you want to set in the text block below (simply, no need for double hashes to escape)
No need for saving, It's automatic
Restart VS Code
terminal cwd screen
Try this option in the "Intergrated Terminal" section of Settings.
"terminal.integrated.cwd": "",
You can also set it to a relative path to the open folder with
"terminal.integrated.cwd": "./example"
So if you do menu File → Open Folder... → project, and open the terminal with your keyboard shortcut, it will open to ~/project/example automatically.
It can be a general folder like src you would always use, or a specific one (but then it would be best to save it in file .vscode/settings.json).
The below option will help you do this.
Menu File → Preferences → Settings.
Add or edit the below setting.
terminal.integrated.shell.windows": ""
From the next terminal it will be reflected.
And add file .profile to your default shell, and add the default path to it.
More information can be found
at Integrated Terminal.

Why does VS2012 think my command keys are me attempting to edit code?

E.g. when I hit Ctrl-D, I for an immediate window, I have to move my mouse pointer out of the code window, or I get told I'm not allowed to edit code while it is running. I've only recently encountered this.
Not knowing how your Visual Studio is setup, I cannot say. However, try doing the following:
Open Visual Studio 2012 then go to Tools > Options...
In the Options menu, go to Environment > Keyboard.
From there, click inside the "Press shortcut keys:" input box and, using your keyboard, type CTRL + D. Once you do that, it will show you what command is currently using that shortcut.
Finally, type in the command name in the "Show commands containing:" input box. Click the command name from the list below, then click 'Remove'.
Hope this is what you are looking for! Let me know if you have any other questions!

Disable WerFault.exe/"Application Has Stopped Working" crash dialog

I have a development tool that's crashing on launch, and I don't get to see any error messages it throws, or get a chance to debug it, because it shows the Windows 7 dialog for crashed programs, where it says "Windows is checking for a solution..."
I want to have my old school big ass assert dialog box back, with a big "DEBUG" button. I have JIT completely enabled in Visual Studio's options and settings, so I'm not sure why I'm not getting the option.
Use Regedit, navigate to the below path:
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\Windows Error Reporting\DontShowUI]
Create a DWORD and set the value to 1.
This blog post on raymond.cc contains an expanded version of the steps suggested in Krzysztof John's answer.
Quote:
Turn Off The Error Dialog Via The Registry
Although editing the registry manually is not recommended for average users, sometimes there isn’t a choice because something like the Group policy Editor might not be available in your version of Windows or the group policy method itself doesn’t work. This works on Windows Vista and above.
Open the Registry Editor by typing regedit into the Start search box or the Win+R Run dialog.
Navigate to the following registry key:
HKEY_CURRENT_USER\Software\Microsoft\Windows\Windows Error Reporting
Double click the DontShowUI entry on the right and change its value to 1, then close the registry editor.
. . .
The above registry fix will turn off the popup dialog for the current user, if you want the setting to affect all users on the computer then a similar registry key needs to be created in the registry at HKEY_LOCAL_MACHINE. This key isn’t present by default so needs to be created.
Read More: https://www.raymond.cc/blog/disable-program-has-stopped-working-error-dialog-in-windows-server-2008/
control panel -> troubleshooting -> change settings
In my case this solved same problem:
Control Panel\All Control Panel Items\Action Center\Problem Reporting Settings
set to "never check for solutions"
On my old Windows Vista Home Basic install, the option is hidden in a completely different place beneath the control panel:
Control Panel → Classic View → Problem Reports and Solutions → Change Settings → Advanced Settings → “For my programs, problem reporting is: [×] Off”

In Visual Studio when viewing a changeset, how can I change the view of cs files?

In Visual Studio with TFS as source control, when I view the history and double click a cs file, the file is loaded in notepad. How can i change the application to be notepad++?
I also would like the OS's default application for the file to still be visual studio
After pouring over ProcessMonitor logs I think I found the solution!
You need to change the what the Windows shell (explorer) thinks the "Edit" action for text files. I was able to change this key:
HKEY_LOCAL_MACHINE\SOFTWARE\Classes\SystemFileAssociations\text\shell\edit\command
to something other than Notepad (in my case notepad2). Now Visual Studio's TFS's changeset dialog opens cs files with that editor.
This will probably change the edit option for not just cs files, but everything considered "text'. The registry entries for file associations are pretty complicated. I suspect that it would be possible to disassociate .cs files from this common "text" category and make this change only for cs files (but I'm not that ambitious). Also, I wouldn't be surprised if people's file associations / shell commands (open, edit, etc...) vary from machine to machine (OS versions, tools installed, etc) - so YMMV.
The only way I found is to replace notepad with notepad++. This article describes how to do it. Don't forget to check the comments to get a link to the "little exe" that comes with notepad++.
Works like a charm on W7 x64.
Cheers,
Phil
\I was able to configure this by adding new value to the registry.
OS: Windows 7 Enterprise x64
Steps on how to do it.
Run: Regedit (alt + r, type regedit)
Look for HKEY_LOCAL_MACHINE\SOFTWARE\Classes\SystemFileAssociations
Right click "SystemFileAssociation" -> add new key then name it as .cs
Right click .cs and add new key then name it as shell
Right click shell and add new keys name it as edit and open 6
Right click edit and add new key command then change the default value to point to the file exe you want it to run.
ex: C:\Program Files (x86)\Notepad++\notepad++.exe %1
Don't forget to add the %1 at the end of the .exe
do the same for open
Hope it helps.
I don't see any options in Visual Studio for changing that, so I'm guessing it uses the system's default text editor.
Try assigning Notepad++ as the default handler for *.cs files.
You can do this from withing Notepad++ by going to Settings/Preference/File Association.
You can also do it by right-clicking on a .cs file in explorer, go to Open With/Choose Program..., then select Notepad++ and check the "Always use the selected program to open this kind of file" box before hitting OK.
The only thing that works for me is when I set the default program for the particular file type in Windows Explorer to open with the VS IDE:
C:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE\devenv.exe
This opens the code in a new instance of VS. Not ideal, but at least it's easier to read.

Resources