How to debug Ionic app on Android device from Visual Studio - android

I have an Ionic app that I can debug in Visual Studio 2015 using Ripple. I now want to debug in a tablet that has Android 4.2.2 installed.
So I downloaded the jsHybugger app as described on MSDN (except I didn't purchase a license, so skipped step 5 - "Place the jshybugger_license.xml file in the root of your project").
Now I hit a problem when I select "Device" as the debug target. I get this error:
MSBUILD : cordova-build error BLD10205: Please install Android target ""
So I opened Android SDK manager and installed everything under the 4.2.2 target. I then got a new error:
Unable to start program 'C:\Program Files\Eclipse\adt-bundle-windows-x86_64-20140702\sdk\platform-tools\adb.exe'
I don't use Eclipse, and there is another copy of adb.exe in C:\Program Files (x86)\Android\android-sdk\platform-tools, so I uninstalled Eclipse and ran a repair on the Visual Studio 2015 installation.
I then got (the command being ....cordova\build.bat):
Command failed with exit code 2
I went to Tools-> Options-> Tools For Apache Cordova -> Cordova Tools -> Clear cache, and this caused a fresh install of the Cordova tools. However I still get the "Command failed with exit code 2" error.
How do I fix this mess?

I had the same issue a while ago, and by following the steps in this post solved it for me.
Ensure that you have Android version 19 installed. I was targeting Jelly Bean, and I still got this error...

Related

Visual Studio 2017 Tools -> Android disabled

When I try to run a new blank Android app I get an error:
"The Android SDK Directory could not be found...".
I searched in google for a solution and I found out that I need to go to Tools -> Android -> Android SDK Manager, and then I realized the buttons are disabled.
I did some checks:
in Tools -> Options -> Android Setting for Android SDK Location and it's empty. Furthermore, the folder Programs Files(x86)\Android\android-sdk contain only 1 folder named extras
I did a VS repair, twice, and nothing changed.
As I understand the problem, I don't have SDK and somehow VS can't install it properly.
Is there any manual way to install it or any other solution?
Edit: I've tried to uninstall Visual Studio and install again. It couldn't install everything successfully, here is the log:
Package 'JavaJDKV2,version=1.8.6,chip=x64' failed to install.
Search URL
https://aka.ms/VSSetupErrorReports?q=PackageId=JavaJDKV2;PackageAction=Install;ReturnCode=-1
Details
Command executed: "C:\ProgramData\Microsoft\VisualStudio\Packages\JavaJDKV2,version=1.8.6,chip=x64\jdk-8u181-windows-x64.exe" /quiet
Return code: -1
Return code details: Unknown error (0xffffffff)
Log
C:\Users******\AppData\Local\Temp\dd_setup_20180828172213_290_JavaJDKV2.log
Impacted workloads
Mobile development with .NET (Microsoft.VisualStudio.Workload.NetCrossPlat,version=15.8.27906.1)
Impacted components
Android SDK setup (API level 27) (Component.Android.SDK27,version=15.8.27906.1)
Google Android Emulator (API Level 27) (Component.Google.Android.Emulator.API27,version=15.8.27906.1)
Java SE Development Kit (8.0.1120.15) (Component.JavaJDK,version=15.6.27406.0)
I fixed it and here is what worked for me:
I downloaded the Android Command line tools
I put the downloaded folder in C:\Program Files (x86)\Android\android-sdk
I opened CMD and directed to that folder.
I've checked the command sdkmanager --list, see sdkmanager page for more information
And I downloaded via the sdkmanager commands the SDKs I needed
Also, VS2017's SDK manager started to work as well after I downloaded what I needed from the command line.
download the latest version of "sdk-tools-windows-4333796.zip" in https://developer.android.com/studio this web site and update your visual studio to latest version
this will surely work because even in my case it was same error for 3days then i did these changes and now it works fine
Install Android studio - https://developer.android.com/studio
Open Android studio -> configure -> copy Android SDK location
Open Visual studio -> Tools -> Options -> Xamarin -> paste your SDK location
Done!

ionic run android error: Could not find an installed version of gradle either in android studio

I got this error when i run ionic run android in my ionic 3 app console.
I saw many posts of it in stack over flow but nothing solve my issue.
ANDROID_HOME=C:\Users\XXXX\AppData\Local\Android\sdk
JAVA_HOME=C:\Program Files\java\jdk1.8.0_101
Error: Could not find an installed version of Gradle either in Android Studio,
or on your system to install the gradle wrapper. Please include gradle
in your path, or install Android Studio
I had same issue with cordova app (not ionic 3). I uninstalled sdk android and I installed Android Studio and now it works.

Error creating a new Native-Application (Android) in Visual Studio

I just installed Visual Studio 2015 Update 3 and included Visual c++ cross-platform for Android. The installation was successful. After installation I created a new project Native-Activity Application (Android).
Upon building the project to execute it in an emulator, I encountered the following:
Error MSB3073 The command ""C:\Program Files (x86)\Microsoft Visual Studio 14.0\Apps\apache-ant-1.9.3\bin\ant.bat" debug -Dout.final.file="C:\Users\Admin\Documents\Projects\Exp\Android3\Android3\Android3.Packaging\ARM\Debug\Android3.apk"" exited with code 1. Android3.Packaging C:\Program Files (x86)\MSBuild\Microsoft\MDD\Android\V140\Android.Common.targets 378
Why am I getting the error? Am I missing something?
I had gotten a very similar error when I created a new Native Android Application using Visual Studio 2015. It turned out in my case that there were additional errors in the output tab saying that it could not find android-19. So what I did was used visual studio 2015 "Tools->Android->Android SDK Manager" to install Android 4.42 (API 19) and I was able to build my solution.

Error in running Cordova apps in Visual Studio

When I make a new typescript Cordova application in Visual Studio, a page comes open with:
Please fix the following issues to ensure that your app builds and runs successfully.
Android SDK : The override value set on the Environment Variable Option Page pointed to an invalid or nonexistent location for this software.
When I run the app with ripple -Nexus (Galaxy), in error list I have 2 errors:
Please install Android targer " Android-19 "
cmd: Command failed with exit code 8
Does anyone have the answer?
You did not installed the SDK right!
click "Start" and look for "Android SDK Tools" - "SDK Manager", under "Tools", the following should be installed:
Android SDK Tools
Android SDK Platform Tools
Android SDK Build Tools for rev 19.1
Then install everything inside Android 4.4.2 (API 19)
If you cannot find SDK Manager, which means that you did not install Cordova correctly.
If you are using Visual Studio 2013 Community Update 4, you need to install Tools for Apache Cordova CTP3.1
If you are using Visual Studio 2015 Community RC, you need to select "Tools for Apache Cordova" during the installation of VS 2015.
If you are inside China or some other countries that block access to Google, you need to make sure you can access dl.google.com before you install Tools for Apache Cordova.
If you think that you install everything properly and still get the error, in Visual Studio, go to "Tools" - "Options" - "Tools for Apache Cordova" - "Environment Variables Override" and check the ADT_HOME variable, is your Android SDK installed in the path stated in the ADT_HOME?
Still not ok? in "Tools" - "Options" - "Tools for Apache Cordova", use "Clear Cordova Cache", then the system hangs about a minute or two, then it will ok, and you can rebuild again.

Can't execute my app in Android SDK with Titanium Studio 3.1.0

I'm on iMac with X.8.3 and i'm trying to make my test application working with Titanium Studio and Android SDK 2.2, the apps works on iPhone Simulator but not on Android.
Here is the terminal error when trying to execute the app in Android Emulator
"[INFO] logfile = /Users/*****/Documents/Titanium_Studio_Workspace/Geocoder/build.log
[ERROR] : Build process exited with code 1
[ERROR] : Project failed to build after 208ms
[ERROR] : Emulator process exited with code 1"
and the log file says the same.
I've tried the android emulator with Eclipse and it works pretty well!
On the Dashboard page of Titanium Studio the icon of Android SDK stay in Red, it says
"Android configuration details.
One or more pieces are missing from the Android SDK. It may be that the Android SDK is already installed and Titanium Studio cannot locate the directory, or it may be that some additional components need to be installed.
Items required:
An Android SDK is missing. Titanium requires Android platform 2.2.*
Add-On Google APIs version 8"
I've already tryied to remove and install it all 2 times and it doesn't change anything.
In the preferences of Titanium / Studio / Plateforms / Android it's seems to be Ok with the android sdk, the dropdown android sdk sees 3 versions of android 4.2.2 and Google API.
I just had the same problem while trying to start the Kitchen Sink app. In my case the problem was that tiapp.xml referred to and Android SDK that was not installed on my machine.
I changed the SDK version number in these lines from 11 to 14
<uses-sdk android:targetSdkVersion="14"/>
<tool-api-level>14</tool-api-level>
Another possible option would be to install the SDK version that is called in tiapp.xml.
Answer 1 :
Seems build tools got moved to another directory with the latest Android SDK update. Created symlinks to aapt and dx in /Applications/Android-sdk/platform-tools:
ln -s /Applications/Android-sdk/build-tools/17.0.0/aapt aapt ln -s /Applications/Android-sdk/build-tools/17.0.0/dx dx
This solved it for me (after some digging in their Python code).
Answer 2 :
I'm on windows so i used mklink. I had to add a link to lib/dx.jar for it to work. What I dit was first add folder 'lib' to platform-tools folder and after in command line:
cd %YOUR_ANDROID_DIR%\platform-tools
mklink aapt.exe ..\build-tools\android-4.2.2\aapt.exe
mklink dx.bat ..\build-tools\android-4.2.2\dx.bat
cd lib
mklink dx.bat ..\..\build-tools\android-4.2.2\lib\dx.jar
Answer 3 :
I copied the following files:
C:\Android\build-tools\17.0.0\aapt.exe to C:\Android\platform-tools\aapt.exe
C:\Android\build-tools\17.0.0\dx.bat to C:\Android\platform-tools\dx.bat
C:\Android\build-tools\17.0.0\lib to C:\Android\platform-tools\lib
I then cleaned the project and rebuilt and everything is now working.
Source here: http://developer.appcelerator.com/question/152497/titanium-sdk-310-error-typeerror-argument-of-type-nonetype-is-not-iterable-on-building-android-app#comment-175782
Edit your emulator so that the Target is set to Google APIs for the level you want to use.
If this happens with Kitchen Sink demo, the fix is to go into the Android SDK Manager and install "Android 3.0 (API 11)". Make sure the app uses emulator "Google APIs (Android 2.3.3)" and "WVGA854". I assume there's a Titanium bug because you have to install a higher API level (3.0) than is actually used (2.3.3).

Categories

Resources