Android_Home issue on MAC - c#

I have set the ANDROID_HOME environment variable on my MAC but still getting an error says:
The ANDROID_HOME environment variable is not set to the Android SDK root directory path. ANDROID_HOME is required for compatibility with SDK 23+. Checking along PATH for adb.[ADB] Error: Could not find adb Please set the ANDROID_HOME environment variable with the Android SDK root directory path.
I have used the following commands in the Mac's terminal:
MacBook-Pro:~ seleniumMac$ export ANDROID_HOME=/Users/seleniumMX/Library/Android/sdk
MacBook-Pro:~ seleniumMac$ export PATH=$PATH:$ANDROID_HOME/tools
MacBook-Pro:~ seleniumMac$ export PATH=$PATH:$ANDROID_HOME/platform-tools
MacBook-Pro:~ seleniumMac$ export PATH=$PATH:$ANDROID_HOME/build-tools

Run the following commands after installing brew
brew tap caskroom/cask
and install android-sdk using
brew cask install android-sdk
Now copy the below to your ./bash_profile and save/source it.
export ANDROID_HOME=/usr/local/Caskroom/android-sdk/
export PATH=$ANDROID_HOME/platform-tools:$PATH
export PATH=$ANDROID_HOME/tools:$PATH
Open a new terminal!

Related

Dotnet: Works in VSCode's OWN TERMINAL, but OMNISHARP: 'dotnet.exe' is not recognized

How is this possible?
I installed .net sdk 6.0.405: dotnet-sdk-6.0.405-win-x64.exe
I can in windows terminal and power shell run: dotnet --version: 6.0.405 ✅
I CAN ALSO IN VSCODE IN ITS BUILTIN TERMINAL, run: dotnet --version: 6.0.405 ✅✅
But in the OUTPUT tab, choosing OmniSharp Log from the dropdown, it says:
[ERROR] A .NET 6 SDK for x86_64 was not found. Please install the latest x86_64 SDK from ...
I switched vscode explorer settings to use external terminal.
And this terminal setting to command prompt:
Terminal › Integrated › Default Profile: Windows
The default profile used on Windows. This setting will currently be ignored if either terminal.integrated.shell.windows or terminal.integrated.shellArgs.windows are set.
I have dotnet in the PATH (and it works in terminals and in vscode's terminal)
I restarted vscode, AND REINSTALLED the dotnettools "C# for Visual Studio Code (powered by OmniSharp)" extension. I went to the online store and from the right column under Resources I downloaded the ms-dotnettools.csharp-1.25.2#win32-x64.vsix to make sure I get the right one. And restarted vscode.
I tried this setting:
Omnisharp: Dotnet Path
Specified the path to a dotnet installation to use when "useModernNet" is set to true, instead of the default system one. This only influences the dotnet installation to use for hosting Omnisharp itself. Example: "/home/username/mycustomdotnetdirectory".
C:/Program Files/dotnet/sdk/6.0.405
And this setting:
Omnisharp: Sdk Path
Specifies the path to a .NET SDK installation to use for project loading instead of the highest version installed. Applies when "useModernNet" is set to true. Example: /home/username/dotnet/sdks/6.0.300.
C:/Program Files/dotnet/sdk/6.0.405
And restarted vscode. And now it says:
[ERROR] Error: Command failed: dotnet.exe --version
'dotnet.exe' is not recognized as an internal or external command,
operable program or batch file.
What? W H A T? lol
What could be wrong? Why isn't it saying where it expected to find it and what to do to locate it? Is there a setting to specify the dotnet.exe path to this C# extension? Does it need always-on internet or something? Does it have DRM? Does it need Edge installed? Wtf?🙂
🙃😭 I just need intellisense; and I've wasted 2h, on only microsoft-owned products.
#Microsoft 0/5 stars
Still don't know why it happens, but here's how to solve it:
The problem was from this: I like to keep all my visual studio code extensions as .vsix files locally in folders so I can remember and get them easily & offline. Sensible enough choice, and I had the correct ms-dotnettools.csharp-1.25.2#win32-x64.vsix for my platform.
But in VSCode, when I install this particular extension via VSIX, even though it succeeds, it can't find .net. If you instead install the extension "normally", ie via vscode's own download, it seems vscode does some extra configuration steps while installing, and probably sets the .net paths correctly or something. Because now it works.
So TL;DR: don't install ms-dotnettools.csharp via vsix, it seems bugged. 😶
Would love to see an answer explaining what's wrong / how to actually do via vsix; but I don't have any more time to debug this rn.

The file ChromeDriver does not exist when running on Docker

I'm trying to run Selenium on Docker using Azure Function in C#. I've installed Selenium.WebDriver and Selenium.WebDriver.ChromeDriver nuget packages. In docker file I've also put code for installing Chrome driver, but when I try to create ChromeDriver in code, I get exception that chromedriver can't be found.
When I list all files in directory, I can see that there is chromedriver.exe file listed:
but when I try to create a new Chrome driver using this line:
IWebDriver driver = new ChromeDriver(Environment.CurrentDirectory);
I get the following exception:
The file /home/site/wwwroot/bin/Debug/netcoreapp3.1/chromedriver does
not exist. The driver can be downloaded at
http://chromedriver.storage.googleapis.com/index.html.
Why chromedriver.exe file is not recognized? When I run the same code without Docker, everything works fine.
Add the absolute path of chromedriver.exe to container PATH environment variable
Typically Windows executables end with .exe while Linux executables have no file extension. A file being executable on Linux is a consequence of file permissions rather than some naming convention.
The file path in the exception message uses forward-slashes / as file path delimiters rather than back slashes \ leading me to believe you have downloaded a Windows-compatible ChromeDriver which you are attempting to run on a Linux machine.
Solution: download the Linux driver instead when deployed via Docker.

Unable to determine Workspace using TFS API in C# and TF.exe within TeamCity 9.1.3

I'm working on a Nant build script and attempting to get latest of ProjectInfo.vb and ProjectInfo.cs from C:\workspaces\myproject\thisfolder. In doing so I've tried using both a custom task written in C# and also using the NAnt Exec task to launch TF.EXE. I get the same error with both.
Unable to determine workspace
TF.exe returns error 100. The custom task throws an exception (unfortunately I don't have the exact type of exception written down) but the message returned is the same as when using TF.exe.
UPDATE: I have VS2013 Ultimate with Update 5 installed on the BuildServer running Windows 7 Professional SP1 and attempting to access TFServer 2010.
Has anyone experienced this before?
The error happens when the tf command is unable to determine the workspace. So, you need to either change the working folder to workspace folder, or create a workspace mapping in the current folder.
Check Kiquenet's reply in this link for the details: Unable to determine the workspace using TF.exe
Key steps are quoted for your quick reference:
Create a new workspace
C:\projects\blah>tf workspace /new blah /noprompt /collection:http://:/tfs/ /login:,
Map a path in that workspace
C:\projects\blah>tf workfold /map $/ . /login:,

Adding C# support to SCons on Mac

I found C# support for SCons (https://bitbucket.org/russel/scons_csharp/overview), but I don't know where to install (copy) the python scripts are copied into.
I installed Scons with brew command, so I have /usr/local/Cellar/scons/2.3.4 directory on my Mac.
What should be the next step to install the C# builders?
Please visit the index of all external SCons Tools at http://www.scons.org/wiki/ToolsIndex . Under the section "Install and usage" you can find a list of search directories for each platform.
Note that, since the C# support is not a core package, it's not installed into your default SCons distribution. Instead, it's treated like a customization (decoration?) of the standard sources...hence the machine/user-specific search paths.
Create a directory ~/.scons/site_scons/site_tools.
cd ~/.scons/site_scons/site_tools
hg clone https://bitbucket.org/russel/scons_csharp
Change one line (460) from csharp.py (~/.scons/site_scons/site_tools/scons_csharp/csharp.py).
env['CSC'] = env.Detect('mcs') or 'csc'
We need this change because the default setting for compiler (gmcs) is outdated.
Create build file: SConstruct.
env = Environment(
tools=['scons_csharp']
)
sources = ['Hello.cs']
prog = env.CLIProgram('myapp', sources)
Execute scons -Q to get:
mcs -nologo -noconfig -out:.../myapp.exe Hello.cs
References
http://www.scons.org/wiki/ToolsIndex
http://www.scons.org/wiki/CsharpBuilder

How do I correctly install the Facebook SDK Unity plugin?

My current process is approximatly:
I start with a Disk image of Window 7 x64 with only:
Unity 4.3.3f1, Located 'C:\Program Files(x86)\Unity'.
The adt-bundle-windows-x86-20131030. 'C:\Users\Will\adt...'.
The Java 32bit runtime 1.7.0_51-b13, 'C:\Program Files(x86)\Java'.
'C:\Program Files(x86)\Java\jr7\bin;' is manually added to my 'Path' Environment Varible.
As it is I can cleanly deploy Android projects, however I want to use the official Facebook SDK plugin. At this point on my first attempt to install the plugin I dropped it into a project as per the official 'Getting Started' tutorial and this is where I get a bit lost. Even though there is no mention of it in the 'Getting Started' tutorial I find that OpenSSL is a dependancy of the SDK.
So I install the OpenSSL binary 'Win32OpenSSL-1_0_1f' to 'C:\Program Files(x86)\OpenSSL-Win32' and when the plugin still can't find it I add 'C:\Program Files(x86)\OpenSSL-Win32\bin;' to my 'Path' Environment Variable.
At this point The plugin's 'Debug Key Hash' starts working and I naievly assume that everything is correct, However; When I attempt to deploy a build I recieve the following error:
Error building Player: Win32Exception: ApplicationName='C:\Program Files (x86)\Java\jre7\bin\javac.exe', CommandLine='-bootclasspath "C:/Users/Will/adt-bundle-windows-x86-20131030/adt-bundle-windows-x86-20131030/sdk/platforms/android-19\android.jar" -d "C:\Users\Will\Documents\Unity Projects\test\Temp\StagingArea\bin\classes" -source 1.6 -target 1.6 -encoding ascii "com\DefaultCompany\test\R.java" "com\facebook\android\R.java"', CurrentDirectory='C:\Users\Will\Documents\Unity Projects\test\Temp\StagingArea\gen'
and the build process is halted.
Could anyone help explain where I am going wrong and to get this plugin to behave?
I had the exact same issue - I've solved it by deleting the JAVA_HOME environment variable that pointed to a directory containing JRE (instead of JDK). You also seem to only have JRE installed and the javac.exe file is not part of that package. Alternatively, point JAVA_HOME to the directory on your machine that does have JDK (and javac.exe) installed.

Categories