When I want to try ionic weather app (https://github.com/driftyco/ionic-weather/) I've got problems when I wanted to build android to my phone-gap application using cordova. I receive this message in terminal when I execute the command cordova build android
Error: An error occurred while listing Android targets
I work on ubuntu 13.10
I was able to successfully build the project with the following steps:
npm install -g cordova ionic
git clone https://github.com/driftyco/ionic-weather/
cd ionic-weather
cordova platform add android
cordova build android
You may be missing the required android sdk tools, or they may not have been added to your system path.
Refer to this question
cordova ubuntu: An error occurred while listing Android targets
And follow this guide to ensure your environment was setup correctly.
Related
I m new to cordova/ionic.
I have a cordova project which i want to run either on android device or emulator.
When i run the command : ionic cordova run android.
I get the following error :
Detected locally installed Ionic CLI, but it's too old--using global
CLI.
cordova platform add android --save Using cordova-fetch for cordova-android#7.0.0 Error: Failed to fetch platform
cordova-android#7.0.0 Probably this is either a connection problem, or
platform spec is incorrect. Check your connection and platform
name/version/URL. Error: cmd: Command failed with exit code 1 Error
output:
in the code platform android already exists, but when i check its version it i s, android~6.3.0.
I have tried a number of things to resolve it which includes, reinstalling cordova, android.
Can anyone have a solution for it.
The code was written around a year back and now i have all the latest versions installed in my system
Problem is android platform was not added properly. Therefore you have to add respective Android Platform into your Project.
Before adding run :
cordova platform remove android
After run :
cordova platform add android#6.0.0
if you develop on windows enviroment You can check the version of Android provided by Cordova under :
C:/Users/%USER%/.cordova/lib/npm-cache/cordova-android
You may also want to try adding --nofetch to the command, which will use the pre-7.x behavior. See Cordova 7 fails to add android platform
You can try it by firstly updating your android sdk manager with all the latest updates and also update its gradle. Then try to firstly remove the android platform using command
CORDOVA PLATFORM REM ANDROID
and then add android platform using command
CORDOVA PLATFORM ADD ANDROID.
I just received an ionic v1 app that I have to make some changes,but after a fresh installation of ionic, I'm unable to run it. Every time that I run ionic run android in the ionic CLI, I receive this error:
WARN: ionic.project has been renamed to ionic.config.json, please
rename it. Using this version of Cordova with older version of
cordova-android is deprecated. Upgrade to cordova-android#5.0.0 or
newer.
Error: Your android platform does not have Api.js
For the moment I can not migrate to Ionic 2.
What can I do to run/build it?
Fist of all, when you install Ionic this way
npm install -g cordova ionic
You are getting the last CLI that works with Ionic 2, Angular 2 and a different project structure. If you want to run and build an Ionic v1 project you need the tools that works with your version.
To install a specific version you need to add # symbol after the name package and the version that you want for example:
npm install -g ionic#1.7.14
npm install -g cordova#6.0.0
Also you have to keep in mind that Android has been improving their tools too, and this version of cordova doesn't work properly with the latest Android tools chain. This question can help you to download and setup the android tools for this version of cordova.
After that you will be able to run ionic run android
I have build platform for android and ios at starting of the app.
I want to override android and ios build after some completion of the project.
command I'm using:
ionic platform build android
and it's giving error:
error: Platform "build" not recognized as as core cordova platform. See 'cordova platform list'.
I have tried even:
cordova platform build android
it's showing Available platforms. But apk file is not getting overridden.
What should I do to get a latest apk build output.
The build command is:
ionic build android
I am also facing this error but after uninstall all the ngCordova plugin and reinstall all, then i got No Error.
I am no longer able to build my app and generate an apk anymore because an error shows up. Here is what happens when I try to build the app in the command prompt: Command Prompt
Can somebody please help me with this? Oh and this is what happens if I type ionic info in the command prompt:
Your environment has been set up for using Node.js 0.12.4 (x64) and npm.
C:\Users\Singh>ionic info
Your system information:
Cordova CLI: 5.1.1
Ionic CLI Version: 1.6.1
Ionic App Lib Version: 0.3.3
OS: Windows 7 SP1
Node Version: v0.12.4
C:\Users\Singh>
Try to remove the platform, and then add it again, and then build your application.
So, if you have android as targeted platform execute these commands:
ionic platform remove android
ionic platform add android
ionic build android
My son had a very similar problem, and we never did figure out what caused it. He ended up creating a brand new blank ionic project, and then just copying the www folder from the old project. It worked, and he was able to get things building again. If you try it, you'll also have to re-add your plugins, copy package.json and bower.json, and then rerun bower install and npm install. It's not pleasant, but it might be worth a shot if you're desperate.
I am trying to create a simple project in phonegap with association of wikitude.
This is the tutorial which I followed - wikitude + phonegap tutorial
And I am using ubuntu 12.04 these are the only steps which I followed,
$ npm install -g phonegap - Adding phonegap
npm install plugman - Adding plugman
sudo npm install -g cordova - installing codova
Then following steps to create app,
$ phonegap create MyAugmented - create app
$ phonegap build android - build in android
Aditionally I have installed android sdk using apt-get.
But when I build this app using above build command it gives an error,
Error in Text :
Error: An error occurred while listing Android targets
at /home/sachith/.cordova/lib/android/cordova/3.4.0/bin/lib/check_reqs.js:87:29
at _rejected (/home/sachith/.cordova/lib/android/cordova/3.4.0/bin/node_modules/q/q.js:808:24)
at /home/sachith/.cordova/lib/android/cordova/3.4.0/bin/node_modules/q/q.js:834:30
at Promise.when (/home/sachith/.cordova/lib/android/cordova/3.4.0/bin/node_modules/q/q.js:1079:31)
at Promise.promise.promiseDispatch (/home/sachith/.cordova/lib/android/cordova/3.4.0/bin/node_modules/q/q.js:752:41)
at /home/sachith/.cordova/lib/android/cordova/3.4.0/bin/node_modules/q/q.js:574:44
at flush (/home/sachith/.cordova/lib/android/cordova/3.4.0/bin/node_modules/q/q.js:108:17)
at process._tickCallback (node.js:415:13)
{ [Error: /home/sachith/.cordova/lib/android/cordova/3.4.0/bin/create: Command failed with exit code 8] code: 8 }
[error] /home/sachith/.cordova/lib/android/cordova/3.4.0/bin/create: Command failed with exit code 8
Answers would be really appreciated,
Thanks in Advanced.
Most probable reason is you don't have latest android SDK. So update your android SDK and it should work fine.
You can reference this to see way of finding error.
Cordova has a script to check if all dependencies are present. Is is
called when you run cordova platform add android but unfortunatly it's
output is not displayed when it fails.
You can try to run it manually, it should be
$home/.cordova/lib/android/cordova/3.3.0/bin/check_reqs
The normal output when everything's fine is "Looks like your
environment fully supports cordova-android development!", oterwise it
should display a clear message about what's missing.
Maybe your issue is that you havent't installed SDK platform for API
19 in android sdk manager (cordova 3.3 uses target sdk 19).
UPDATE:
Android SDKs are updated using SDK Manager. You can see how to use SDK from here.
http://developer.android.com/tools/help/sdk-manager.html