Ionic can not add android - 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?

Related

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

Android SDK installed but not seen by cordova

I've installed android studio 3 which sees android-sdk:
The same path I have in enviroments variables but I cannot use android sdk with cordova. (I'm makeing ionic app).
Here is screen shot from IDE:
Edit:
More screenshots:
What cordova is looking for at this step is not the sdk but the sdk tools. Have you installed the sdk tooks (middle tab in your first picture)?
To know what exactly is missing you can use the command
cordova requirements android --verbose
It will show you that cordova is trying to launch the command %ANDROID_HOME%\tools\bin\avdmanager.bat list target and displays that the SDK is not found if the command is not found.

Apache cordova Visual studio 2015 Release error

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

Can't build android project in IONIC framework

I'm trying to build my test app for android device with IONIC framework using WEB technology.
I installed IONIC FRAMEWORK and configured everything with the help of Ionic Framework Docs.
And now I am trying to build android app using command line:
ionic build android
But this gives me Error to install the following targets:
ERROR: Please install android target: "android-23"
I Have a problem to understand about android-23. What's this and how to install it for my android platform tools.
I also updated SDK platform tools and SDK build tools.
API level 23 stands for marshmallow ,have you installed the Android SDK successfully .just check this link,https://googleweblight.com/?lite_url=https://source.android.com/source/build-numbers.html&ei=7Sw_Jjql&lc=en-IN&s=1&m=141&host=www.google.co.in&ts=1458486558&sig=APY536yicvyJBcnb8fM_Ldmz-Kzx9dINVQ

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