setting up development environment for PHONEGAP - android

Starting with phonegap and installed the following:
ANT from apache
ANDROID SDK (which includes SDK + ECLIPSE + ADT PLUGIN)
now as guided here phonegap documentation i am trying to check proper functioning of following commands
java
ant
java commands run fine. But when do the ant, i get the following:
C:\Users\Mrinal>ant
Buildfile: build.xml does not exist!
Build failed
Is it a normal behavior? Also I do not understand the fourth step in the above link.

It is normal. It means Ant is properly running on your machine.
Now follow the Getting Started guide for Android

Related

Could not find gradle wrapper within Android SDK

i am new in Ionic. I added android platform in my ionic application and tried to run the application in real android device but i am getting following error in my command prompt i am using windows 10 machine on my end.
Error: Could not find gradle wrapper within Android SDK. Might need to update your Android SDK.
Looked here: C:\Users\CURRENT_USER\AppData\Local\Android\sdk\tools\templates\gradle\wrapper
following are my environment variables:
ANDROID_HOME=C:\Users\CURRENT_USER\AppData\Local\Android\sdk
JAVA_HOME=C:\Program Files (x86)\java\jdk1.8.0_121
Please suggest
I think you need to update android sdk,
First you update your android sdk atleast API LEVEL 19 & tools & extra options
as follow
& make sure to add sdk url in environment variable
New Android Studio has moved gradle wrapper to C:\Program Files\Android\Android Studio\plugins\android\lib\templates\gradle\wrapper. I copied the templates\ folder to sdk\, then passed the compilation. However the command "Ionic emulate android" still failed with "Error: cmd: Command failed with exit code 1". I don't know how to go further :(

Unable to add platform in ionic project

I am new to ionic. I am able to install ionic and also create a new project based on this link http://ionicframework.com/docs/guide/installation.html.But when I try to add a platform it says failed with exit code ENOENT.
I tried to yield debug information by "ionic -d platform add android" as suggested in https://stackoverflow.com/a/32360435/5820057.
I got this msg.
What does it mean? "Failed to find bower component 'android'". Is there any issues with the CLI version?
Android on OS X note gives you an error, searching it;
typing "?
Make sure JAVA_HOME is set, as well as paths to your JDK and JRE for java in browser tab" will result in cordova based errors.
means ionic is wrapper around cordova, so most probably cordova will give you the exact error.
Also make sure all required variable are available in PATH.

Meteor Crosswalk build fails at second 'ant debug' step

I have a Meteor Cordova Android app which I'm trying to migrate and build using Crosswalk. I followed the steps from here:
https://meteor.hackpad.com/Building-Meteor-app-with-Crosswalk-kHKh4DzGxFQ
Until here, the build succeeds.
android update project --subprojects --path . --target "android-19"
ant debug
cd ..
ant clean
The next step, ant release or ant debug, the build fails with 100 javac errors. The error log is very close to whats mentioned here: https://github.com/meteor/meteor/issues/3076
The solution partly is here:
https://github.com/RayHuo/MyXwalk/wiki/MIGRATE-AN-EXISTING-CORDOVA-APPLICATION-TO-CROSSWALK-WITH-CORDOVA-3.4-OR-LATER.
Its says:
"And the solution is to changing the second ant debug to cordova build android"
But the android project folder is generated by Meteor and not Cordova, so I do not have cordova executable installed to run a cordova build android.
I still tried installing cordova separately and building it, but it simply says, 'its not a cordova based project'.
How do we do the last step using Meteor? There is another option to build it using Eclipse/ADT, but I want to figure this out within the Meteor build process.
I know I'm missing something simple here. Any help is greatly appreciated!
Thanks.
crosswalk provides a HelloWorld cordova/example via the bin/create
utility on the intel crosswalk website.
that CordovaLib directory can replace the meteor equivalent
,however the latest meteor version fails, so there maybe some
crosswalk/meteor version problems now to resolve.
HelloWorld appears to work with old version 8 crosswalk
and new meteor build
https://crosswalk-project.org/documentation/cordova/develop_an_application.html
Meteor 1.2 now supports CrossWalk with $ meteor add crosswalk

phonegap doesn't generate platforms/android subdirectory?

Hi!
I've decided to try out phonegap but i am having trouble getting it set up with eclipse using the CLI as the guides seem to be outdated and inaccurate. Here's what i've done so far to get the phonegap project set up in eclipse:
"phonegap create hello" to create a new phonegap project
then i tried "phonegap platform add android", but gave me a 'is not a node' error
from this question i got the idea that i should instead use "phonegap build android", so i used that command.
According to the android platform guide in the official phonegap website it says that now there should be a platforms/android subdirectory in the phonegap project folder, but there isn't. The platforms folder is completely empty.
Have i missed something? Thank you very much for your help :)
Please try phonegap install android.
By just typing phonegap without any arguments you'll get the basic help and when you want to know more of a specific command do phonegap help <subcommand>
Personally I found the Cordova CLI documentation to be a little more in depth and if you're just building locally you'll have no big difference between the cordova command and the phonegap command as far as I've been able to tell. You only really need the phonegap command if you're using PhoneGap Build as well.
Example:
% phonegap
Usage: /usr/local/share/npm/bin/phonegap [options] [commands]
Description:
PhoneGap command-line tool.
Commands:
create <path> create a phonegap project
build <platform> build a specific platform
install <platform> install a specific platform
run <platform> build and install a specific platform
local [command] development on local system
remote [command] development in cloud with phonegap/build
help [command] output usage information
version output version number
% phonegap help install
Usage: /usr/local/share/npm/bin/phonegap install [options] <platform>
Description:
Installs the application for a specific platform.
Automatically detects platform SDK support and uses the correct environment.
See each environment for available [options].
Examples:
$ /usr/local/share/npm/bin/phonegap install android

Upgrading Phonegap Android from 2.5 to 2.6 and 2.7 step

Hi I have problem upgrading Phonegap from 2.5.0 to 2.6.0 and 2.7.0 and specifically with step 8. I'm following the steps from the documentation Upgrading Cordova Android
Copy files from bin/templates/cordova to the cordova directory in your project
Where should I put those files, so they could upgrade my project?
The Android Phonegap conversion docs have changed significantly. There's no longer a step by step process that walks through each upgrade requirement. Instead, theres an "update" program that theoretically does the upgrade automatically. It didn't exactly work this way for me. After going through the documented update process (one step now) I had to go through my project and make sure everything was in place - specifically the cordova-2.7.0.jar and the cordova-2.7.0.js files.
I've just finished upgrading an Android project from Phonegap v2.5.0 to Phonegap v2.7.0. The process I followed was:
Back up the Android project.
Execute the Phonegap update command for v2.7.0 as described in the PG upgrade documentation
Change the current directory to Phonegap for Android directory:
$ cd /phonegap-2.7.0/lib/android
Execute the update command:
$ ./bin/update YOUR/CORDOVA/PROJECT/DIR
Ensure that Eclipse is referencing the correct Phonegap library in the libs directory: cordova-2.7.0.jar.
I also deleted the reference to the previous jar file.
Make sure that the phonegap javascript file (cordova-2.7.0.js) is referenced appropriately in the index.html file.
From within Eclipse: Project/Clean
Build the project and test.
I'm also trying to upgrade from 2.5.0 to 2.7.0 and running the update.bat file gave me the following message: Missing one of the following: JDK: java.oracle.com Android SDK: developer.android.com Apache ant: ant.apache.org – Etienne Desgagné May 27 at 2:15"
You need to check your 'path' System Variables in Environment variables under advanced system settings. JDK is the Java Development Kit and you check if it's correct by 'echo %JAVA_HOME% in a terminal. Ant is an apache thing and again you check that's correct by 'echo %ANT_HOME% and then you just need to make sure your Android SDK folder is in the path variable.

Categories

Resources