Can't build android project in IONIC framework - android

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

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?

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

Cordova not building app

I am new to cordova. Trying to work out with it but when I check requirements it says Android Target not installed while I have installed SDK in Android Studio.
Required information for troubleshooting can be found here.
I am using Windows 8.1 32 bit installation. I have already tried previous answers found oh the site.
Update
I just noticed that running cordova build android gives
D:\Android\Apps\hell>cordova platform ls
Installed platforms:
android 7.0.0
Available platforms:
browser ~5.0.1
ios ~4.5.4
osx ~4.0.1
windows ~5.0.0
www ^3.12.0
Indicating android version to be 7.0.0 thus API is 24.
But D:\Android\Apps\hell\platforms\android\CordovaLib\project.properties have :
# Indicates whether an apk should be generated for each density.
split.density=false
# Project target.
target=android-26
apk-configurations=
renderscript.opt.level=O0
android.library=true
Here target is set to android-26, which is Android 8.0
From what I can tell the path setting for the SDK is missing. Check the Cordova documentation for that. Follow it to the letter.
Also Android 7.0.0 is not the version of Android, but of the Cordova code for Android.
Josem might be onto something as well, unless you've already done that step.
Perhaps the platform android is not installed.
Can you see it?
ionic cordova platform list
If it is not there, you can add it:
ionic cordova platform add android
Here is the documentation.

Cordova does not "see" Android SDK version

I am in the process of setting up a new Cordova CLI toolchain to build hybrid Android apps that target Android 5.1+. I am using
Node 8.9.2
Cordova 7.1.0
After issuing a cordova create... command to create a new Cordova project I proceeded to add Android 5.1 using cordova platform add android#5.1.0 which went smoothly.
I have also ensured that I have the relevant Android SDKs available and pointed at properly via ANDROID_HOME. I currently have SDKs 19 through to 27 installed.
However, when I issue a cordova build android I get the message Error: Android SDK not found. Strangely enough if I let Cordova install its current default Android version via cordova platform add android which adds Android 6.3.1 it then lets me build the project without any further ado.
Is this a matter of Cordova 7.1.0 simply not wanting to play ball with lower versions of Android or is there something else going on here? Can I get around this by installing an older version of Cordova via npm? If so, which version should I install - and how?
Your problem is you're adding an old version of the cordova-android platform project, (v5.1.0) which is over 2 years old and not compatible with the cordova#7.1.0 CLI.
If you want to target Android 5.1+, you don't need to use cordova-android#5.1.0, you need to specify a preference in the config.xml to target Android 5.1 (API 22) and above:
<preference name="android-minSdkVersion" value="22" />
You probably want to use the default cordova-android platform version (6.3.1), unless you need to do stuff with Android Studio 3, in which case use cordova platform add android#latest which will add cordova-android#7.0.0 and requires Gradle 4 to build (see here).

PHONEGAP - Error while starting emulated android on phonegap; I use the SDK installed by android Studio

The error I get on the console; When I run the command "phonegap emulate android"
->Error: Could not find gradle wrapper within Android SDK. Might need to update your Android SDK. Looked here: C:\Users\wende\AppData\Local\Android\sdk\tools\templates\gradle\wrapper
I also experienced this issue (among many others) in my attempts to get a phonegap app to work in my environment.
I found a solution in the second response (by jcesarmobile) to this question:
Error: Could not find gradle wrapper within Android SDK. Might need to update your Android SDK - Android
Specifically, I had to make sure my Android Studio and Android SDK Tools were updated to the latest version, and then I had to update my Cordova Android platform to version 6.2.2.
phonegap cordova platform rm android
phonegap cordova platform add android#6.2.2

Categories

Resources