Android Studio SDK Manager won't open - android-studio

I'm trying to open the SDK Manager in Android Studio, but everytime I get an error. The first time I open it, I see a progression bar which completes. But nothing opens. If I try again I get this error message:
Cannot launch SDK manager.
Output:
'xcopy' is not recognized as an internal or external command,
operable program or batch file.
ERROR: SWT folder 'lib\x86_64' does not exist.
Please set ANDROID_SWT to point to the folder containing swt.jar for your platform.
There are other topics on Stackoverflow with the same question. From those topics I discovered that maybe my Path environment variable is causing the error. I tried multiple things, but the error is still there..
My Systemvariables Path is:
C:\Python27\;C:\Python27\Scripts;%M2_HOME%\bin;%JAVA_HOME%\bin;%M2%;C:\Program Files\Microsoft SQL Server\110\Tools\Binn\;C:\Program Files\Microsoft SQL Server\120\Tools\Binn\;C:\Program Files (x86)\Windows Kits\8.1\Windows Performance Toolkit\;C:\Program Files (x86)\Java\jdk1.7.0_67\bin\Microsoft SDKs\TypeScript\1.0\
Edit: The problem is fixed. I reinstalled Android Studio multiple times and somehow it worked.

Related

error cannot open file 'kernel32.lib'

I have installed VS2013 and VS2015 on Windows 7.
I have an existing C++ Dll project that was building fine but now all of a sudden it wont build using VS2015 and gives me the error:
LINK : fatal error LNK1104: cannot open file 'kernel32.lib'
From this post: fatal error LNK1104: cannot open file 'kernel32.lib' I went looking for the kernel32.lib file and it is located here:
C:\Program Files (x86)\Windows Kits\8.1\Lib\winv6.3\um\x86
When I go to my Projects Properties-->Linker-->Input and select Macros I see that this path is indeed there:
My Platform Toolset is set to Visual Studio 2013 - Windows XP (v120_xp) which is what it always has been set to.
Why has my Project all of a sudden stopped building? What could have gone wrong?
I had this similar problem today with Visual Studio 2013 when I changed my VC++ Directories:
Project->Properties->VC++ Directories:
Include Directories
If the cause is some plug-in/extension that changes your props files, it may in consequence change the "Visual C++ Directories" settings of your project.
So, the solution that worked for me is described on my own answer Can't compile 64 bits Visual Studio 2010 projects, which I fully transcribe to here:
After I asked a colleague for help, we noticed, that even getting
clean builds of the projects from TFS, with overwrite option, the
Project's Configuration Properties > VC++ Directories on my computer
were always different from other computers.
Searching more we found the solution on the last post of Reset
include/lib path, which I will fully transcribe:
use "del %HOMEPATH%\AppData\Local\Microsoft\MSBuild\v4.0\Microsoft.Cpp.Win32.user.props"
is not always the right way.
Better use "del %USERPROFILE%\AppData\Local\Microsoft\MSBuild\v4.0\Microsoft.Cpp.Win32.user.props"
where the application data folder is normally placed in.
Then I've looked inside the contents of Microsoft.Cpp.x64.user.props
and I've seen that there were things added by Visual Leaks Detector.
Which is reasonable, as one month before, I did a memory leak analysis
using VLD.
So, I deleted the file and now everything compiles fine at 64bits!
I had to install the Visual C++ for Desktop Development.
Open Visual Studio Installer and go to Installed tab. Click on the Change Button on your installed Visual Studio Community Edition. -> On the Workloads Tab there should be a option Desktop Development with C++. Activate that option and modify the changes.
Afterwards it was working for me.
I had the same problem today. As it turned out somehow the SDK 10.0.15063.0 got installed on my system but without the Desktop C++ files. Selecting the SDK in the list of installed programs, doing a change install and there selecting the Desktop C++ options added the necessary files and now I can link again.
I got this error fatal error lnk1104: cannot open file 'kernel32.lib'.
this error is getting because there is no path in VC++ directories.
To solve this probelem
open visual studio 2008
go to Tools-options-Projects and Solutions-VC++ directories-*
then at right corner select Library files
here you need to add path of kernel132.lib
In my case It is C:\Program Files\Microsoft SDKs\Windows\v6.0A\Lib
Thank you.
I had this following upgrade of some projects from VS2013 to VS2017.
Original project had a manual modification to the "Library Directories" item under VC++ Directories in the project settings.
This meant it did not pick up changes from the upgrade.
Using the option will reset this to something that works (assuming the SDK is installed OK) provided anything other than the default is not needed of course. In my case it was trying to point at the v7.1 SDK but that was not installed for vs2017.
in vs 2019, just run the installer, click modify, and then in the individual components tab, remove windows 10 SDK. then again run the installer and add windows 10 sdk!
I had this similar problem today with Visual Studio 2017. My cause turned out to be a bad environment setting in NETFXSDKDir, specifically:
NETFXSDKDir=C:\Program Files (x86)\Windows Kits\NETFXSDK\4.6.1
It needed to have a value of:
C:\Program Files (x86)\Windows Kits\10\Lib\10.0.10240.0\um\x86
I have a more detailed response here:
fatal error LNK1104: cannot open file 'kernel32.lib'
In VS 2022 I was trying to compile an old solution that originally ran in VS 2010 then in VS 2019. It continually gave me the "cannot find Kernel32.lib" error. I spent 8 hours trying everything, including everything on this page. What worked for me: Configuration Properties -> VC++ Directories -> Library Directories and "inherit from parent" (guessing this sets to defaults) fixed this for me. Also note: I'm using winsock and directinput.

Error trying to run Visual Studio 2012 Ultimate Coded UI tests in Chrome

I seem to have everything installed properly but still getting an error.
Microsoft.VisualStudio.TestTools.UITest.Extension.UITestException: The playback engine could not find Selenium binaries on your system. You need to install both the Selenium .NET bindings and Selenium Chrome driver to run cross browser coded UI tests.
1) Using VS2013 Ultimate 11.0.51106.01 Update 1
2) d/l and ran CodedUITestCrossBrowserSetup.msi
3) chromedriver comes up manually using version 26.0.1383.0
4) copied SeleniumDotNET files to "C:\Program Files (x86)\Common Files\microsoft shared\VSTT\Cross Browser Selenium Components"
Looked at all the docs I could find. Is there something I am missing?
tl;dr
If this file doesn't exist, create a dummy one:
C:\Program Files (x86)\Common Files\microsoft shared\VSTT\Cross Browser Selenium Components\castle.core.dll
Long version
I couldn't get VS2012 Premium Update 2 (not CTP) working with 'Selenium components for Coded UI Cross Browser Testing' from here:
http://visualstudiogallery.msdn.microsoft.com/11cfc881-f8c9-4f96-b303-a2780156628d
The Visual Studio testing code in this dll:
C:\Program Files (x86)\Common Files\microsoft shared\VSTT\11.0\UITestExtensionPackages\Microsoft.VisualStudio.TestTools.UITest.Extension.CrossBrowser.dll
... looks for this file:
....\Cross Browser Selenium Components\castle.core.dll
... but it doesn't exist.
To fix the problem, create any old file called castle.core.dll in the 'Cross Browser Selenium Components' folder. For my machine, I just created a zero length file called castle.core.dll it started working.
I've had the same problem and have added the castle.core.dll like Andrew suggested (just the new zero length file in the C:\Program Files (x86)\Common Files\microsoft shared\VSTT\Cross Browser Selenium Components) and it started to work.
I reinstalled all the add-ons including VS2012 Update 2 CTP and it is now working for me.

MSOXMLMF.DLL Cannot find or open the PDB file

I have migrated a project from Visual studio 2008 to Visual Studio 2012. After migration, I am not able to run the application because it is throwing
C:\Program Files\Common Files\microsoft shared\OFFICE14\MSOXMLMF.DLL. Cannot find or open the PDB file. message on the output window and my application is getting aborted.
Can anyone help me out on this?
Run your application with WinDbg
issue the ".reload" command as:
.reload /f SRV*D:\MySymbols*http://msdl.microsoft.com/download/symbols
The part between the ** is a path on your system. The command will download the matching symbol files for all loaded modules.

How to change Visual Studio 2012 install directory?

I've uninstalled VS11 using the the windows installer, and deleted just about every registry key I could find relating to it, but it still pops up with this when I try to reinstall it:
And I can't click the "..." or edit the path. Right-clicking does nothing either.
What do I have to destroy to change the install directory?
Still happening in official release:
I had the same problem though instead of forcing me to install into "c:\program Files" it forced me to install to the directory which I used for the Visual Studio RC. After using Process Monitor and the setup's logfile I was able to find a registry key that needed to be deleted.
The key was located at
HKLM\Software\Microsoft\Windows\CurrentVersion\Installer\UserData\S-1-5-21-776561741-789336058-725345543-318838\Components\31F687BD8A467D54C830E018D99F7F3B
The SID will most likely be different for other systems yet you might be able to find the last string (31F687BD8A467D54C830E018D99F7F3B)
In order to find the key I did the following:
Downloaded ProcessMonitor from Sysinternals
Started Processmonitor with filter
Image Path ends with vs_premium.exe
Started vs_premium.exe
Closed the setup
Waited until Processmonitor didn't fetch anymore events
Opened the newest dd_vs_premium_.log file from %TEMP%
Searched for something and found
Condition 'VS_Install_path_KeyExists' evaluated to false. (i guess it will evaluate to true on affected systems. I tried this on a clean windows installation)
One line above it said
Registry key not found. Key =
'SOFTWARE\Microsoft\VisualStudio\SxS\VS7'
Searched for
Microsoft\VisualStudio\SxS\VS7
in Processmonitor
A few lines down ProcessMonitor shows me the key I had to delete
A simpler approach worked for me:
1 - Run the installer from the command line, with /uninstall /force switches, as in:
c:\vs_professional_ENU.exe /uninstall /force
2 - Re-run the installer normally.
I did this with VS2015 under Windows 10. Reference link.
The only solution I've found is on Windows 7 to create a hard Junction link to the directory your wanting Visual Studio installed to.
For Example, My SSD drive is not my boot drive and has a drive letter of B:.
I run the following command line
mklink /J "C:\Program Files (x86)\Microsoft Visual Studio 11.0" "B:\Program Files (x86)\Microsoft Visual Studio 11.0"
To the installer and Windows it thinks it installed it to the Program Files x86 directory on C: drive when it really installed it to the Program Files x86 folder on B: drive.
Here's a link to page about creating Junction links in Windows Vista and 7. http://www.howtogeek.com/howto/windows-vista/using-symlinks-in-windows-vista/
I dont have the rep to comment on the post above. Although he is correct in the syntax of those command switches, the program is bugged, it doesnt work with selecting the CustomInstallPath. In fact, for me, it just decides to open about 50+ iterations of vs_ultimate.exe in the process list...
I will try the Hard Junction as mentioned above as I am sure that will work.
As a sidenote, if anyone is interested, you can use the switch that allows you to acquire the installation ahead of time by running vs_ultimate.exe /Layout X:\somefolder\
I did that last night and hopefully my installation will go quickly since i havea ll the info, however I think in order to force it to use the offline version, you have to run vs_ultimate.exe /noweb.
This page refers to all the switches: http://msdn.microsoft.com/en-us/library/e2h7fzkw(v=vs.110).aspx
The above pages notes that: /p CustomInstallPath "Installs all re-targetable packages in the directory that you specify." Thay may mean that silently, whatever it is able to install off of your root drive, it will, but its hard to be certain and I have limited space on my SSD.
Before I try the hard junction, I may also try the above and see what heppens, then uninstall it if need be. Will post results
Try launching the installer with the following option:
/p CustomInstallPath="[your_path]"
For example:
vs_ultimate.exe /p CustomInstallPath="C:\MyDirectory"
To see all options use the switch /?
For me the final visual studio 2012 wanted to install into the same path as the (uninstalled) beta. I deleted most of the stuff in HKLM that had an exact match for the setup directory (ending with a \ e.g. C:\VS11Beta\) and then the setup let me choose again.
Probably not a solution for the OP(M:\Program Files sounds too generic to delete), but perhaps for others with this problem.
I had previously installed the VS 2012 Test Controller. Uninstalling it allowed me to change the install path.
How to change Visual Studio 2012 install directory?
What do I have to destroy to change the install directory?
Answer: You can change the physical directory without the need to "destroy or change" the install directory. This is an alternative "think smarter not harder" solution proposal.
Here are the specific material details you need to continue to use your logical M:\Program Files directory and solve the physical where the files are stored problem.
It also serves the rest of the community well for cleaner more reproducible installs, less effort and risk when using Beta builds. Its less risk because it encapsulates every file in the beta install. Want to go from beta to RC, no problem, just don't mount the beta drives, use an off the shell registry cleaner and reinstall clean to fresh drives every time.
The process uses PGP disks which can be logged in and logged out of / backed up as needed.
Initially, it seemed as though it would be possible to create just two drives. not so.
- Drive #1 mounted as F:\ for f:\Program Files (x86)\Microsoft Visual Studio 11.0
This is where I told Visual Studio setup to install files to. And it does function as a mountable container for 2.7 Gigs of files.
Drive #2 mounted as a folder on "C:\Program Files (x86)\" "Microsoft Visual Studio 11.0"
The intended purpose of the mounted folder was to collect up the remainder of 5.5 Gigs of files.
The actual list of 33 created folders I had to move to additional PGP folders.
Here is the inclusive list of folders you can create before setup deploys files to them.
C:\Program Files\Microsoft SQL Server
C:\Program Files\Microsoft SQL Server Compact Edition
C:\Program Files\Application Verifier
C:\Program Files\MSBuild
C:\Program Files\Microsoft
C:\Program Files\IIS Express
C:\Program Files\IIS
C:\Program Files\Microsoft Visual Studio 11.0
C:\Program Files (x86)\IIS
C:\Program Files (x86)\IIS Express
C:\Program Files (x86)\Microsoft ASP.NET
C:\Program Files (x86)\Microsoft Help Viewer
C:\Program Files (x86)\Microsoft SDKs
C:\Program Files (x86)\Microsoft SQL Server
C:\Program Files (x86)\Microsoft SQL Server Compact Edition
C:\Program Files (x86)\Microsoft WCF Data Services
C:\Program Files (x86)\Microsoft Web Tools
C:\Program Files (x86)\MSBuild
C:\Program Files (x86)\NuGet
C:\Program Files (x86)\Windows Kits
C:\Program Files (x86)\Common Files\Merge Modules
C:\Program Files (x86)\Common Files\Microsoft
C:\Program Files (x86)\Common Files\microsoft shared\DevServer
C:\Program Files (x86)\Common Files\microsoft shared\MSDesigners8
C:\Program Files (x86)\Common Files\microsoft shared\MSEnv
C:\Program Files (x86)\Common Files\microsoft shared\MSI Tools
C:\Program Files (x86)\Common Files\microsoft shared\SQL Debugging
C:\Program Files (x86)\Common Files\microsoft shared\SQL Server Developer Tools
C:\Program Files (x86)\Common Files\microsoft shared\TextTemplating
C:\Program Files (x86)\Common Files\microsoft shared\Visual Database Tools
C:\Program Files (x86)\Common Files\microsoft shared\VS7Debug
C:\Program Files (x86)\Common Files\microsoft shared\WF
C:\Program Files (x86)\Common Files\microsoft shared\Windows Simulator
This is perfect to prevent;
- Patch managers and patch management systems which inadvertently & unsupervised unmonitored, unaudited in willful ignorant bliss violate the premise of good promotion to production change control best practices
Developers who's code mostly works by random chance and really have no idea whats in the final product.
Hacker exploitation of the build environment.
Could have used True Crypt or PGP desktop. Just not whole disk encryption, have to be able to mount and unmount the resources.
I appreciate the hard junction approach, but unless you Safely ejecting & power off drives, it offers little process compliance and is neither safe or reliable as compared to safe PGP un-mounting/mounting. Developers will just power on the drives and make changes.
Regarding level of efforts to backup and restore, Backing up PGP drives as compared to hard junctioned drives is a wash about the same level of effort. But the value in not having to remember which folders are junctioned, which might need restored to restore a dev environment favors the fewer number of .PGD drives which contain all the needed folders ( ie do the remembering for you as a part of their function)
Consider this as an environment for when requirements are for mandatory non discretionary absolute auditable surety for a reproducible secure build. To meet that core objective, it has to be available only when its actually "needed" and has to be secured when its not needed.
Look into your installed programs and see if an instance of Visual Studio is already installed if so delete it and re-run the set up.
For this who still looking for a solution, What I tried and learned from this issue is that while "normal" (from control Panel) uninstall not every signatures of VS is not getting removed. So we have force uninstall from command line to remove all VS footprints. I have found the following answer in stack overflow very useful for me.
Run installer in command line (Admin) with argument:
vs_community_ENU.exe /uninstall /force
Then:
run vs_community_ENU.exe (or professional/enterprise).
How to install Visual Studio 2015 on a different drive

Include stdlib.h :No such file or directory in vc++

I compiled my c++ program in the directory
D:\Program Files\Microsoft Visual Studio 9.0\VC\bin
But stdlib.h is present in the path.
D:\Program Files\Microsoft Visual Studio 9.0\VC\include
While compiling my program, it throws the following error in the command prompt.
fatal error c1083:cannot open include file:"stdlib.h":No such file or directory
NMAKE : fatal error U1077 :'.\c1.exe' : return code '0x2
How to solve this issue.Please take a look into it.
Thanks.'
If you compile from the command-line, you should use the Visual Studio Command Prompt as it sets common environment variables that are used for compiling.
If for some reason you insist on using cmd.exe then you have to either add the include paths to the INCLUDE environment variable or you have to give the compiler the command-line parameter /IC:\Path\to\include
Details are available on MSDN
edit: well since this got recently upvoted I might as well add what I forgot last time. If you want to set up the environment variables that the Visual Studio Command Prompt uses you can just execute the vcvarsall.bat which is located in a directory like C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC for details consult the relevant MSDN page
Make sure you have the right platform toolset selected.
Project -> properties -> configuration properties -> Platform toolset
If you move a project from computer to computer via a flash drive or something, it can have an invalid toolset selected. That can cause intellisense to tell you that.

Resources