Issue with WIndows MDHA with visual studio 2013 - android

I'm trying to learn something about multy hybrid app developing under visual studio 2013 using Apache Cordova. I've just created a new project and i'm trying to build it but when I try to build it for android I get 1 warning and 1 error.
warning:
Warning 1 The TypeScript Compiler was given no files for compilation, so it will skip compiling. C:\Program Files\MSBuild\Microsoft\VisualStudio\v12.0\TypeScript\Microsoft.TypeScript.targets 95 5 helloWorld
error:
Error 2 The command ""C:\Users\user01\AppData\Roaming\npm\node_modules\vs-mda\vs-cli" build --platform "Android" --configuration "Debug" --projectDir . --projectName "helloWorld" --language "en-US" --buildServerUrl "" --buildTarget "AndroidEmulator"" exited with code 1. C:\Users\user01\AppData\Roaming\npm\node_modules\vs-mda-targets\Microsoft.MDA.targets 99 5 helloWorld
I've googled those errors but I haven't sorted anything out. Do you know what is the problem?

The issue is because of Android target (latest version) is not available with Android SDK. Make sure the following in your system,
Go to Android installed folder (for me, C:\Users\username\AppData\Local\Android\android-sdk)
Go to tools folder and select "android.bat" Run as Administrator
Check whether the latest version of Android (ex: API 19) is installed or not
If it is not installed, select that API, click install by accepting License
If it is installed, close it and then Go to to root folder(ex: C:\Users\username\AppData\Local\Android\android-sdk)
Double click on the AVD Manager and create new AVD
Now I hope, you can able to build and run the application.

Related

I cannot configure Visual Studio Community 2019 to compile android aplication to .apk file

I watched many tutorials on how to setup VSC 2019 to develop mobile aplication in C++, but every time i try to compile i get an error related to missing .apk file ( screenshots below ). I have properly configured android emulators ( android 7.1 and 11.0 ). This is native-activity application project.
When compiling to android 7.1 emulator for the first time:
Error installing the package. The package 'C:\Users\Doomguy\source\repos\Android3\Android3\Android3.Packaging\x86\Debug\Android3.apk' does not exist on disk.
When trying to install on android 7.1 emulator ( when i have application compiled ):
The command ""C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\Apps\apache-ant-1.9.3\bin\ant.bat" debug -Dout.final.file="C:\Users\Doomguy\source\repos\Android3\Android3\Android3.Packaging\x64\Debug\Android3.apk"" exited with code 1.
This is my configuration manager:
Configuration manager window
This is my property page for Packaging:
Packaging tab property page
It also seems, that other project types compilation works just fine with them finishing first try.
This is also my build.xml file ( I have rolled up all the comments - nothing important ).

Android Studio Error : installed build tool revision 32.0.0 is corrupted

I'm on Android Studio 4.1.1. I created a new project and haven't added anything to the starter code and whenever I click build or run, I get this error:
Installed Build Tools revision 32.0.0 is corrupted. Remove and install again using the SDK Manager.
I am using android studio for the first time and wanted to print a simple hello world program , and this is becoming pain in the ass.
Please try the following instructions (assuming you are working on MS Windows):
Firstly, locate your SDK folder, e.g. %ANDROID_SDK_ROOT%.
Copy (NOT Rename) %ANDROID_SDK_ROOT%\build-tools\32.0.0\d8.bat to %ANDROID_SDK_ROOT%\build-tools\32.0.0\dx.bat
Copy (NOT Rename) %ANDROID_SDK_ROOT%\build-tools\32.0.0\lib\d8.jar to %ANDROID_SDK_ROOT%\build-tools\32.0.0\lib\dx.jar
Verify if build issue has been fixed.

Taco Android build Error

I just started learning building andoriod apps using Microsoft's open source software called taco, and I followed the steps they have on taco.tools and the problem comes when I use the Command taco build android I get the error No install build tools found , Error:cmd: commmad failed with exit code 1. I have however installed the build tools and checked if they were installed via the sdk manager.
Please see images
and also
It looks like you have two installs of the Android SDK. To fix: set your environment variable ANDROID_HOME=C:\Users\Insight\AppData\Local\Android\android-sdk
This issue is caused by Visual Studio installing the SDK into AppData, and Taco installing the SDK into Program Files.

Visual Studio 2015 hangs when create/open a Cordova project

I used Visual Studio 2015 to develop mobile app with Cordova. Before I upgraded to Windows10, I was using Windows 7 and it worked perfectly fine. After I've upgraded to Windows10, whenever I open a Cordova project or create a Cordova project the Visual Studio hangs (not responding).
I have tried to reinstall the Visual Studio but it still hangs.
Anyone has faced this problem before?
Thanks
Here is the solution for this problem in VS 2015. This issue if you have Windows 10 and latest updates in VS 2015 including latest type script installation.
1) Open command prompt as administrator.
2) Navigate to the following folder path:
cd "C:\ProgramData\Package Cache"
3) write the following command to find out vs_edition.exe file:
dir vs*exe /s /b
4) copy the full path that contains your vs edition exe from the screen.
5) write the following command:
"C:\ProgramData\Package Cache\{GUID}\vs_enterprise.exe" /modify /installselectableitems Javascript
6) VS installer will start, click on modify and then update. no need to change any features selection.
7) Wait until the installer finishes.
8) From the command prompt, navigate to the following folder:
C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE
9) Run the following commands:
devenv /updateconfiguration
devenv /clearcache
Below screenshot shows the full commands set.
Now, you will be able to open VS 2015 and create cordova apps.
This is a known issue, and the solution is mentioned in the following link.
I still had few more issues with the Blank Cordova Project which would simply not build once the hanging issue was fixed. I'll share my experience here to help others.
After recovering from the VS.Net2015 hanging I was still getting
"Error MSB3073 The command "platforms\android\cordova\clean.bat" exited with code 1. BlankCordovaApp7 C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v14.0\ApacheCordovaTools\vs-mda-targets\Microsoft.MDA.FileMirroring.targets 354"
I tried reinstalling the Android Studio again and found that it was not working, and the issue was: I had installed a 32 bit Java SDK on 64Bit OS. After In installed the 64Bit JDK and correcting the Path variable to point to this directory, I was able to start the Android Studio.
Now my Blank Cordova project was still not compiling with an error
'MySQL' is not recognized as an internal or external command, BlankCordovaApp7 C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v14.0\ApacheCordovaTools\vs-mda-targets\Microsoft.MDA.FileMirroring.targets 287
This was an interesting one, looks like its an issue with MySQL, in the PATH variable there were some & within the path. I used "" to surround those path
Now its compiling and also able to start the Ripple.
Hope it helps someone as it took me more than 2 weeks to fix.
Regards
Kiran
Today , solved for me with Visual Studio Tools for Apache Cordova Update 2 for VS2015 Enterprise & Windows 8.1. ;-)
I think there are some updates for Visual Studio 2015. I reinstalled it and it is working now.
Here is what I did:
Uninstall the Visual Studio 2015 using the installer (vs-community.exe) from https://www.visualstudio.com/en-us/downloads/download-visual-studio-vs.aspx
Install Visual Studio 2015 using the same installer(vs-community.exe) and choose Typical Installation
After the installation is done, run the installer (vs-community.exe) again and choose Custom Installation and choose to install Apache Cordova
Then I am able to open and build Cordova project
Not sure if this helps.
In my case with VS2015, the problem was about missing SDK build tools for Android. The lack of information is due to the fact that Visual Studio does not show all the build information by default. Once more information is shown, we could see issues with third party dependency issues like Android build tool. There are a couple of ways to get more information during a build.
MSBuild build output verbosity
Dependency checker on the Cordova tools
Both of these are available from the tools menu. For more information see this post:
http://www.ozkary.com/2016/01/visual-studio-2015-apache-cordova.html
hope it helps.

Please install Android target: "android-21" but it is installed?

My problem
I have been using the Tools for Apache Cordova template in visual studio to build an app it has been working for me for like two months no problem at all but then suddenly yesterday after I built it like 6 times it just stopped working.
In VS you get some really bad build errors that don't tell you much about the problem like:
Severity Code Description Project File Line Source
Error C:\Konstruktion\MyFirstApp\MyFirstApp\MyFirstApp\platforms\android\cordova\build.bat: Command failed with exit code 1 MyFirstApp C:\Konstruktion\MyFirstApp\MyFirstApp\MyFirstApp\ERROR building one of the platforms 1 Build
and
Severity Code Description Project File Line Source
Error C:\Konstruktion\MyFirstApp\MyFirstApp\MyFirstApp\platforms\android\cordova\build.bat: Command failed with exit code 1 MyFirstApp C:\Konstruktion\MyFirstApp\MyFirstApp\MyFirstApp\MDAVSCLI 1 Build
So I did try to build it without the help of visual studio with just the CMD commands this was the error I then got:
[Error: Please install Android target: "android-21"]
Hint: Open the SDK manager by running C:\Users\username\AppData\Local\Anndroid\sdk\tools\android.BAT
You will require:
1. "SDK Platfrom" for android-21
2. "Android SDK Platform-tools (latest)
3. "Android SDK Build-tools (latest)]
Error: cmd: Command failed with exit code 2
at ChildProsses.whenDone (C:\Users\myUsername\AppData\Roming\npm\node_modules\cordova\node_modules\cordova-lib\src\cordova\superspawn.js:134:23)
at ChildProcess.emit (events.js:110:17)
at mybyClose (child_process.js:1015:16)
at Process.ChildProcess._handle.onexit (child_process.js:1087:5)
(This is handwritten sens I don't know how copy to the entire output from cmd if you know I can update the question).
Things I have tried so far
re-install the asked tools and sdk platforms via SDK manager
re-install the entire sdk
this Stack Overflow question
What will I try today?
The awesome solutions readers can come up with!
Install everything on a different computer and try there
Try it on windows-10 (like that will help)
Images
I found why the problem appears. This is a problem that only affects user how uses Cordova tools for Visual Studio! (I think).
If you start a build and then cancel it if you have device or emulator selected it will corrupt some files in the debug folder:
C:\Konstruktion\myApp\myApp\myApp\bin\Android\Debug
or where you have put it.
If you don't know where it is just right click the project name in the solution explorer and then click "Open path in File Explorer"
Navigate to the debug folder and delete it's contents, build again and it should work again.
bin\Android\Debug

Categories

Resources