Hi I was successfully created my first phonegap application by running
$ phonegap create percentage
Now i want to run it. So I run this command:
phonegap run android
However it throw me this error:
http://pastie.org/9076710
Anyone have idea about this?
Thank you
Try this one
Install ant using brew.
Download and install Homebrew by executing following command in terminal:
ruby -e "$(curl -fsSL https://raw.github.com/Homebrew/homebrew/go/install)"
Install Apache Ant via Homebrew by executing
brew install ant
Run the PhoneGap build again and it should successfully compile and install your Android app.
Related
I have a react native project in ubuntu, and I want to build android app for production.
I have read this article Generating Signed APK, which say run the following in a terminal:
$ cd android
$ ./gradlew assembleRelease
But when I run this I got this error message
sudo: ./gradlew: command not found
My question is what package I have to install on ubuntu to start build andriod's app
I have a weird problem in my Ubuntu 14.04.
I was developing a mobile application using Ionic with an API using Django-Rest-Framework. After developing, I downloaded jdk and Android SDK so that I can build the mobile app into APK. I also downloaded the android dependencies or tools needed for building. After I downloaded it all, I go to my mobile app folder and type ionic platform add android to build it. But the terminal response with "No command 'ionic' found". Even typing ionic serve responses the same. I also tried to activate the virtual environment of the API using workon mobile but it responses with workon: command not found. Does anybody have an idea what might be wrong? Thanks
First Check ionic is install or not by using following command
ionic -v
It shows version if it nothing to show then install ionic by using following command
sudo npm install -g ionic
else update ionic by the following command on your terminal
sudo npm update -g
And also if you have not got the result then create symbolic link by using following command
sudo ln -s /usr/bin/nodejs /usr/bin/node
Hope this will help you !!
First install using this two line..
npm install -g cordova ionic
ioniv -v && cordova -v
and then use this line
$ ionic start myapp [template]
$ cd MyIonic2Project/
$ ionic serve
I,m unable to add android platform support to phonegap/cordova project.
when I run following command on CLI :
cordova platforms add android
it's giving this error :
Error: ERROR : executing command 'ant' , make sure you have ant installed and added to your path
you need to clean up your eclipse
cd to your eclipse directory and run this command
./eclipse -clean
Download and install Homebrew by executing following command in terminal:
ruby -e "$(curl -fsSL https://raw.github.com/Homebrew/homebrew/go/install)"
Install Apache Ant via Homebrew by executing
brew install ant
Build project
cordova build android
Today I tried PhoneGap/Cordova with Mac OS X Mavericks. Building for iOS went just fine, but building for Android wasn't without some guesswork.
I installed Android 4.2.2 via the Android SDK Manager (I had to use the older API v17 since it wasn't compatible with a newer one), added the PATH environment variables for the SDK's platform-tools and tools and thought I was ready to take off by running the command:
phonegap run android
Nevertheless, I got the following error:
[phonegap] detecting Android SDK environment...
[phonegap] using the local environment
[phonegap] adding the Android platform...
[error] An error occured during creation of android sub-project. ERROR : executing command 'ant', make sure you have ant installed and added to your path.
The error message proved to be true as Apache Ant isn't in the path of Mac OS X Mavericks anymore.
Bulletproof solution:
Download and install Homebrew by executing following command in terminal:
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
Install Apache Ant via Homebrew by executing
brew install ant
Run the PhoneGap build again and it should successfully compile and install your Android app.
You can install ANT through macports or homebrew.
But if you want to do without 3rd party package managers, the problem can simply be fixed by downloading the binary release from the apache ANT web site and adding the binary to your system PATH.
For example, on Mountain Lion, in ~/.bash_profile and ~/.bashrc my path was setup like this:
export ANT_HOME="/usr/share/ant"
export PATH=$PATH:$ANT_HOME/bin
So after uncompressing apache-ant-1.9.2-bin.tar.bz2 I moved the resulting directory to /usr/share/ and renamed it ant.
Simple as that, the issue is fixed.
Note Don't forget to sudo chown -R root:wheel /usr/share/ant
As an alternative to homebrew, you could download and install macports. Once you have macports, you can use:
sudo port install apache-ant
it don't needed port and brew!
because you have android sdk package.
.1 edit your .bash_profile
export ANT_HOME="[your android_sdk_path/eclipse/plugins/org.apache.ant_1.8.3.v201301120609]"
// its only my org.apache.ant version, check your org.apache.ant version
export PATH=$PATH:$ANT_HOME/bin
.2 make ant command that can executed
chmod 770 [your ANT_HOME/bin/ant]
.3 test if you see below message. that's success!
command line execute: ant
Buildfile: build.xml does not exist!
Build failed
I encountered the same issue when trying to use Cordova. Turns out I already had brew, try which brew, but it was outdated. So, I had to update it first:
Update brew: brew update
Install Apache Ant: brew install ant
In my case, I have macport installed already. I simply updated my macport:
sudo port selfupdate
sudo port upgrade outdated
Then install apache-ant:
sudo port install apache-ant
Finally, I add ant to my alias list in my .bash_profile:
alias ant='/opt/local/bin/ant'
Then you are all set.
For OSX your path needs to include /Users/yourusername
their example: /Development/adt-bundle/sdk/platform-tools
needs to be: /Users/yourusername/Development/adt-bundle/sdk/platform-tools
I have installed Cordova along with Phonegap and installed node.js in my system(ubuntu)
by using following commands:
Install Nodejs http://nodejs.org/
Install Cordova 3.0.x
$ sudo npm install -g cordova
Install Phone Gap 3.0.x
$ sudo npm install -g phonegap
Then i created project using phonegap command:
$ phonegap create hello
Trying to run into my local by using following command:
$ phonegap local run andriod
Now at first i am getting following error:
shoaib#shoaib:~/Documents/hello$ phonegap local run android
[phonegap] adding the Android platform...
[error] An error occured during creation of android sub-project. /home/shoaib/.cordova/lib/android/cordova/3.0.0/bin/create: line 54: jar: command not found
This i solved by running following command:
ls -la /home/shoaib/.cordova/lib/android/cordova/3.0.0/bin
Now when i again run
$ phonegap local run andriod
I am getting below error:
root#shoaib:/home/shoaib/Documents/hello# phonegap local run android
[phonegap] compiling Android...
[error] An error occurred while building the android project. /bin/sh: 1: /home/shoaib/Documents/hello/platforms/android/cordova/build: not found
I am using Android SDK 17
and version as 4.2.2 .
Any solution for this issue?
I had a similar problem. build and run were missing along with a few other files and lib was an empty directory. Downloaded cordova-android from here extracted and copied everything from its /bin/templates/cordova/ to the project (/platforms/android/cordova/). Then I could build and install the app.
Still had to start the emulator, check the running emulator with platforms/android/cordova/lib/list-started-emulators and then pass it when installing or it would take forever to install it on an emulator.
$ platforms/android/cordova/lib/list-started-emulators
emulator-5554
$ phonegap install --emulator=emulator-5554 android
I had already installed the JDK but the same error.
To fix this I just removed the phone test project and make sure that:
Java, javac and jar where in the path
(both should work)
java -version
javac -version
jar -version
Android sdk path was properly set and JAVA_HOME environment variable was properly set.
Then I remake the project and everything worked.
Hey got the solution.
I install open jdk 6.0 and problem is resolved.