I have installed Multi Device Hybrid apps and when I'm building and debugging new project it showing these three errors
Error 1 executing command 'ant', make sure you have ant installed and added to your path. Error 2 C:\Users\User\.cordova\lib\android\cordova\3.5.0\bin\create.bat: Command failed with exit code 8 Error 3 The command ""C:\Users\User\AppData\Roaming\npm\node_modules\vs-mda\vs-cli" prepare --platform iOS --configuration Debug --projectDir . --projectName "BlankCordovaApp2" --language "en-US"" exited with code 8.
But I have set all the paths and adt_home in environment variables and still it is showing this error what to doAnswer1:
Try the following
to check and enable all required Environment Variables for Multi-Device Hybrid App.
Go to Visual Studio -> Debug Menu -> Multi-Device Hybrid Apps -> Environment Variables Settings
Select Required Environment Variable from here as mentioned in the attached screenshot
<img alt="Environment Variable Settings" class="b-lazy" data-src="https://i.stack.imgur.com/w8Lxk.png" data-original="https://i.stack.imgur.com/w8Lxk.png" src="https://etrip.eimg.top/images/2019/05/07/timg.gif" />Answer2:
Make sure ANT_HOME path is set to correct location like
%systemdrive%\apache-ant-1.9.3 and make sure ANT is installed at location ANT_HOME is pointing. Also make sure system path is set to
%ANT_HOME%\bin. You can download ANT from <a href="http://go.microsoft.com/fwlink/?LinkID=396869" rel="nofollow">here</a> in case it is not already installed.
I found the solution to “code 8” errors when building multi-device hybrid application project. The error message you get is: Error 2 \bld\Debug\platforms\android\cordova\build.bat: Command failed with exit code 8 \MDAVSCLI 1 1
This happens if you play around with the config.xml in DevStudio GUI (not textually edit the file). If you change the LaunchMode property and change it back to default value which is "singleTop", a new entry will be added to config.xml: <'preference name="AndroidLaunchMode" value="singletop" />
Just delete the entry, and your project compiles fine again. Quite a nasty bug in DevStudio