Apache cordova Visual studio 2015 Release error - android

After install plugin and try create simple aplication (.apk file) after click on Release get below error.
Build cmd: Command failed with exit code 1

Adding it as an answer as it is descriptive.
Open your project folder in cmd and run cordova plugin list. You should get list of plugins installed in your project with version something like:
cordova-plugin-whitelist 1.2.0 "Whitelist"
pushwoosh-cordova-plugin 5.0.3 "Pushwoosh"
To check android version run android in cmd. It should open Andoid SDK Manager, if not then check the PATH in system variable. If it is fine then update these two if there is any update.
Android SDK Tools and Android SDK Platform-tools under
Tools
Android Support Repository, Google Play Services, Google Repository under Extras

Related

Ionic can not add android

I try to uninstal cordova then instal again but still not working
[ERROR] An error occurred while running subprocess cordova.
cordova.cmd platform add android exited with exit code 1.
Re-running this command with the --verbose flag may provide more
information.
It looks like you need to install your android SDK/build tools.
You can do it manually or using your android studio installation if exists.
To do it with Android Studio you can:
Go to settings->Appearance and Behavior->Android SDK
Go to the SDK Platforms tab and select the latest Android SDK
package.
Go to the SDK Toos tab and select the following checkboxes:
Android SDK Build-Tools
Android SDK Platform-Tools
Android SDK Tools
NDK
Android Support Repository
Google Repository
Apply and accept
To do it without using Android Studio there's an answered question here: How do I download the Android SDK without downloading Android Studio?

ionic cordova bulid android : No installed build tools found. Install the Android build tools version 19.1.0 or higher

What went wrong:
A problem occurred evaluating root project 'android'.
No installed build tools found. Install the Android build tools version 19.1.0 or higher.
Install Android Studio and start a new project. It will then download and install the SDK for you.
If you already have Android Studio installed go to the SDK manager and update the build tools.
The problem has been solved in the paths in .bash_profile
In macOS Catalina, I am facing this problem in ionic 5 Cordova during an android build.
How I solved this?
Set ANDROID_SDK_ROOT environment for Android(because ANDROID_HOME
depricaite ).
Set PATH environment for android build-tools
Save changes and refresh terminal(or close and open terminal).
Delete android platform.
Instal again android cordova platfome using ionic cordova build
android.
At end run command ionic cordova build android

Unable to create mfp cordova project in Android 28

Latest Android SDK is not letting me use android command, as it is deprecated to create a mfp cordova project.
I'm using IBM MobileFirst CLI v7.1.0.00.20180706-0858 and latest Android SDK & Android Studio.
May I know any work around to create a project with mfp cordova?
Updated
Steps to reproduce the issue:
1) Download and install the latest Android Studio and download the latest Android SDK using sdkmanager. Set the system variables to the downloaded SDK buildtools and tools.
2) Download and install the latest MFP CLI v7.1.0.00.20180706-0858.
3) Run mfp cordova create in the command line and the following error happens.
MFP cordova project create Error Screenshot
Android Deprecated Screenshot
Thank you
MobileFirst CLI contains an instance of Cordova CLI v5.0.0, Android platform version 3.6.4.For more details see here :
https://mobilefirstplatform.ibmcloud.com/tutorials/en/foundation/7.1/hello-world/integrating-mfpf-sdk-in-cordova-applications/
Cordova-Android#3.6.4 works only with older tools of android such as Android target: android-23.In your case you have updated your platform tools to latest that is why you are seeing such error.
I have uploaded older tools of android here :
https://ibm.box.com/s/je74bzx73y6je65tdnpttyns4ih1zj7b
Rename or take back up of your existing tools in android sdk path.Put uploaded tools in android sdk path.
With Android P that is targeting to API 28 with MobileFirst 7.1 app ,you may face an error java.lang.NoClassDefFoundError: Failed resolution of: Lorg/apache/http/params/BasicHttpParams;
Work around is to add below tag in AndroidManifest.xml inside the tag:
Google's issue tracker
The same has been update in the
Android P blog

Could not find gradle wrapper within Android SDK. Might need to update your Android SDK [duplicate]

This question already has answers here:
Error: Could not find gradle wrapper within Android SDK. Might need to update your Android SDK - Android
(24 answers)
Closed 5 years ago.
I am trying to take build in an ionic2 application. I got this error while running ionic build android. The error log is
ANDROID_HOME=/home/varun/Android/Sdk
JAVA_HOME=/usr/lib/jvm/java-8-oracle
Error: Could not find gradle wrapper within Android SDK. Might need to update your Android SDK.
Looked here: /home/varun/Android/Sdk/tools/templates/gradle/wrapper
I tried updating the sdk but it was found that the sdk version is latest.
When i looked at the Android/Sdk/tools folder there is no templates directory. I am running on ubuntu 16.04, with cordova version 6.5.0
Edit:
There has been a newer release of Cordova Android that also fixes some problems with SDK tools 26.x.x
cordova platform update android#6.2.2
or
cordova platform rm android
cordova platform add android#6.2.2
Old answer
Google broke Cordova Android 6.1.x and some other frameworks with their latest sdk tools update.
Cordova Android 6.2.1 has been released and it's now compatible with latest Android SDK.
You can update your current incompatible android platform with cordova platform update android#6.2.1
Or you can remove the existing platform and add the new one (will delete any manual change you did inside yourProject/platforms/android/ folder)
cordova platform rm android
cordova platform add android#6.2.1
You have to specify the version because current CLI installs 6.1.x by default.
I resolved by this by replacing the tools folder in my Android SDK with an older version of the SDK tools (r25.2.3). Follow these steps to do the same:
Navigate to https://developer.android.com/studio/index.html, click "Download Options", scroll down, and download the command line tools package for your platform, ensuring that you get a version in the r25.2.X series (not r25.3.X).
Unzip this folder. You should end up with a tools directory.
Navigate to your $ANDROID_HOME directory (~/Library/Android/sdk/ on OS X).
Rename the pre-existing tools directory there to tools.bak (e.g., mv tools tools.bak)
Move the tools directory you just downloaded into the SDK folder (e.g., mv ~/Downloads/tools/ .)
A new major version of the SDK tools was just released, which appears to be causing some issues with Ionic (see the press release here: http://tools.android.com/recent/androidsdktoolsrevision2530feb2017).
This worked for me
cordova platform update android#6.1.2
There's no need to downgrade Android Tools.
On Windows gradle moved from:
C:\Users\you_username\AppData\Local\Android\sdk\tools
to:
C:\Program Files\Android\Android Studio\plugins\android\lib\templates\gradle\wrapper
So you just need to ajust your path so that it points to the right folder.
I had same problem and I solved it with Carlos Delgado's answer.
Android Path must be set before all things below.
Download the latest command line tools (https://developer.android.com/studio/index.html -> very bottom part)
Unzip -> copy and paste "tools > templates" folder to your project folder (/Libraries/Android/sdk/tools/)
press option key to see Libraries folder in your Finder

Unable to add Android platform to Apache Cordova

How do I recover from this error?
[Error: The command android failed. Make sure you have the latest Android SDK
installed, and the android command (inside the tools/ folder) added to your path. Output: ]
You just need to install the Latest version of Android i.e 4.3/4.4
Go to SDK Manager and install the latest SDK Platform.
And try run the command again.
cordova platform add android

Categories

Resources