How to fix build error when running `react-native run-windows`? - windows

After running react-native windows in a freshly initialized React Native app, if you immediately run react-native run-windows this error happens:
Build failed with message Error: Command failed: "C:\Program Files (x86)\MSBuild\14.0\bin\msbuild.exe"
"C:/<path_to_project>/windows/<project_name>.sln" /clp:NoSummary;NoItemAndProperty;Verbosity=minimal /nologo
/p:Configuration=debug /p:Platform=x86
. Check your build configuration.

This can happen when you have installed Visual Studio, but never started it as "devenv.exe" before trying to use some commandline tools. There is some additional setup that happens on first launch of Visual Studio before the commandline tools can be invoked by the react-native run-windows command.
See the React Native Windows troubleshooting section for more information:
https://github.com/microsoft/react-native-windows/blob/0.60-stable/current/docs/SetupTroubleshooting.md

Related

Unable to launch DAML studio

On MacOs, when I try to launch daml studio from command line, I receive several errors and it doesn't launch.
I have gone through all the installation requirements for DAML including installing Visual Studio Code which runs successfully on my Mac as well as the latest Java SDK. I went through the quickstart and DAML successfully works on my system using the IOU on http://localhost:4000. I updated %PATH correctly and have gone through the instructions twice to make sure I'm not missing anything.
Here is what I launch and the results that it is providing...
MacBook-Pro-2:quickstart aron.elston$ daml studio
/bin/sh: code: command not found
Failed to install DAML Studio extension from marketplace.
Installing bundled DAML Studio extension instead.
/bin/sh: code: command not found
Failed to install DAML Studio extension from SDK bundle.
Please open an issue on GitHub with the above message.
https://github.com/digital-asset/daml/issues/new?template=bug_report.md
/bin/sh: code: command not found
Failed to launch DAML studio. Make sure Visual Studio Code is installed.
See https://code.visualstudio.com/Download for installation instructions.
MacBook-Pro-2:quickstart aron.elston$ echo $PATH
/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Users/aron.elston/.daml/bin
MacBook-Pro-2:quickstart aron.elston$ pwd
/Users/aron.elston/.daml/bin/quickstart
MacBook-Pro-2:quickstart aron.elston$
I would expect it to open the project in Visual Studio Code but instead I get errors as shown above.
Looks like the code command to launch VS code isn't available on the command line. That should be fixable by following the instructions here: https://code.visualstudio.com/docs/setup/mac#_launching-from-the-command-line

couldn't determine visual studio generator

I am trying to compile rust's azul gui framework sample code on windows 10 and it's running into the following error:
error: failed to run custom build command for `harfbuzz-sys v0.3.0 (https://github.com/maps4print/azul-dependencies?rev=bf2933b9aac43a7003278862772250398e4fa457#bf2933b9)`
Caused by:
process didn't exit successfully: `F:\Code\rust\azul_demo\target\debug\build\harfbuzz-sys-4d7deefbb1bf663c\build-script-build` (exit code: 101)
--- stdout
cargo:rerun-if-env-changed=HARFBUZZ_SYS_NO_PKG_CONFIG
--- stderr
thread 'main' panicked at '
couldn't determine visual studio generator
if VisualStudio is installed, however, consider running the appropriate vcvars script before building this crate
', C:\Users\Andrew\.cargo\git\checkouts\azul-dependencies-70bb1f94316762f9\bf2933b\cmake-0.1.35\src\lib.rs:687:25
stack backtrace:
0: backtrace::backtrace::trace_unsynchronized
at C:\Users\VssAdministrator\.cargo\registry\src\github.com-1ecc6299db9ec823\backtrace-0.3.29\src\backtrace\mod.rs:66
...
I installed cmake and visual studio 2019. Also note that I am using clion ide. Cmake version is 3.15.2.
It says I should run the appropriate vcvars script before building this crate, what does it mean exactly?
EDIT ----
Found vcvars.bat in the visual studio installation folder and ran it. It's still getting the same error.
EDIT2 ----
It looks like an incompatibility between the latest version of visualstudio(19) and cmake. Reverting to 2015 is suppose to resolve the issue.
https://github.com/maps4print/azul/issues/203
When you install Visual Studio, the command-line tools are not available from a generic command prompt. Visual Studio should have installed an entry in your start menu to start a properly configured console.
Or if you haven't started your console from this special entry, Visual Studio should also have installed a script called vcvars.bat somewhere in its install folder. You need to run that script before you can access the command-line tools.

How to build Visual Studio Installer Project in Azure Devops Pipeline Hosted Agent

I have a Visual Studio setup project. Normally I use the Microsoft Visual Studio Installer Projects extension, and run an MSBuild Exec task with command line using devenv. This works on my dev box and my existing build machine. However I'm looking to migrate to a hosted pipeline agent using the VS2017 image.
I was hoping the installer extension might already be installed, so I tried my build and got an error:
"C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Common7\IDE\devenv.com" "D:\a\2\s\Source\Build..\WindowsFormsApp1\WindowsFormsApp1.sln" /Build "Debug" /Project "Setup1" /ProjectConfig "Debug" /Log
The operation could not be completed. The parameter is incorrect.
I tried adding the VSIX to my repo, and then issuing a command line install of the VSIX as such:
"C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\Common7\IDE\VSIXInstaller.exe" /a /quiet /log:MyTestApp.log D:\a\2\s\Source\Build\InstallerProjects.vsix
However that seems to block for about 10 minutes, and then fails with an error (I suspect the UI is blocking even though I used the /quiet arg to suppress the UI):
... exited with code -2146233088.
Is there any way to build a Visual Studio installer project using a MS-hosted pipeline agent?
How to build Visual Studio Installer Project in Azure Devops Pipeline Hosted Agent
AFAIK, I am afraid we could not build Visual Studio Installer Project in Azure Devops Pipeline Hosted Agent at this moment.
I encountered a similar issue two weeks ago, after a period of investigation, I started to try the same idea as you, using command line to install the Microsoft Visual Studio Installer Projects extension.
However, I got the timeout issue. I could not install that extension on the hosted agent. To test the reason for this, I use the same command lien to installed that extension on another local machine. Indeed, there is a UI window to confirm if you want to install this extension, even after I give the /admin parameter:
Check the options here.
Then I try to open the command line with Administrator and execute the same command line, it can successfully install that extension. So, I want to execute the command line in the Azure DevOps pipeline. But no success. Because we could not execute command line script as admin using Command Line Script task.
It seems we have to set our private agent.
Hope this helps.

Error when building AngularJSToDo hybrid app in Visual Studio

I have installed Multi-Device Hybrid Apps for Visual Studio 2013 - CTP2,and other development tools are properly set up.
Now I get some errors when trying to build for Android, iPhone, and for Windows Phone.
error 1: Cannot find module 'qs'
error 2: “"C:\Users\Administrator\AppData\Roaming\npm\node_modules\vs-mda\vs-cli" prepare --platform Android --configuration Debug --projectDir . --projectName "AngularJSToDo" --language "zh-CN"” exited with code 8。 C:\Users\Administrator\AppData\Roaming\npm\node_modules\vs-mda-targets\Microsoft.MDA.targets
please help me with this problem.
It seems something went wrong while installing Cordova and other dependencies. q module is a library for promise.
Run following npm commands from command prompt,
Close Visual Studio
Open cmd
npm install -g [path to vs-mda example C:\Users\[user-name]\AppData\Roaming\npm\node_modules\vs-mda]
npm install -g [path to vs-mda-targets example C:\Users\[user-name]\AppData\Roaming\npm\node_modules\vs-mda-targets]
Open project and build

Error when attempting to run new blank hybrid app

I currently get the following error when attempting to run a hybrid app using the new cordova ctp for Visual Studio 2013.
Error 11 The command
""C:\Users\Nick\AppData\Roaming\npm\node_modules\vs-mda\vs-cli"
prepare --platform Android --configuration Debug --projectDir .
--projectName "BlankCordovaApp2"" exited with code 1. C:\Users\Nick\AppData\Roaming\npm\node_modules\vs-mda-targets\Microsoft.MDA.targets 115 5 BlankCordovaApp2
Do I need to install something else?
In certain cases, VS does not immediately detect the Android path after installation. Rebooting your machine is the only option for now.
for me I just deleted the bld folder and everything has become right

Resources