Can i build Linphone in Android Studio on Mac? - android

I think we can build it. But I am getting error to build it on Android Studio. First I download the Android Studio and NDK. Then add the PATH of Android Studio and NDK to the PATH Variable. When I run
./check_tools.sh
I get the output
Could not find automake. Please install it.
Could not find autoconf. Please install it.
Could not find pkg-config. Please install it.
Could not find ant. Please install it.
Could not find yasm. Please install it.
Could not find wget. Please install it.
Could not find libtoolize. Please install libtool.
Invalid version of nasm: your version does not support elf32 output format. If you have installed nasm, please check that your PATH env variable is set correctly.
Failed to detect required tools, aborting.
But i doubt whether i need these tool on Android Studio or not. When I run the project i get the error
java.lang.UnsatisfiedLinkError: Couldn't load linphone-armeabi-v7a: findLibrary returned null.
Can anybody tell me the solution for that.

Yes you can do this
follow the step by step guide at this blog
How to build culinphone on Android Studio using Mac OS X?
http://culinphone.wordpress.com
Here is a step to step guide.
Setup Linphone Sdk on Mac OS X
How to build Linphone in Android Studio on Mac?
Step by step guide :-
Required Knowledge :-
Android Tools
Android Studio
A little bit about mac-terminal(shell)
S/W Requirements:-
Mac OS-X with these tools (You definetely need these tools to build linphone) :-
coreutils, automake, autoconf, libtool, intltool, wget, pkgconfig ,cmake,
gmake, yasm, grep, doxygen, ImageMagick, optipng, antlr3
STEP 1:-
Concerning these useful tools you can install the tools with this command
$sudo port install coreutils automake autoconf libtool intltool wget pkgconfig cmake gmake yasm grep doxygen ImageMagick optipng antlr3
STEP 2:-
Check out these Instructions how to upgrade nasm
STEP 3:-
Then install ant by typing
brew update #update if already installed
brew install ant
If you haven’t installed brew just type command give below
its a medium size download which takes 5 mins to download
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
Just follow the process which involves installing various components. If you already have brew installed, make sure it’s up to date by executing:
brew update
Once installed you can simply type:
brew install ant
STEP 4:-
Now its time to install libtool. To install libtool run the command given below
curl -OL http://ftpmirror.gnu.org/libtool/libtool-2.4.2.tar.gz
tar -xzf libtool-2.4.2.tar.gz
cd libtool-2.4.2
./configure && make && sudo make install
STEP 5:-
if you have not installed these programmes download and install
Download Android Studio & SDK
Download Android NDK
STEP 6:-
Download git repository of LInphone Android by running command
$ sudo git clone git://git.linphone.org/linphone-android.git –recursive
Now everything is configured perfectly
STEP 7:-
Open terminal and cd into linphone-android
Now when you get into the directory on terminal then check your PATH of SDK & NDK installed on your Mac run
$ echo $PATH
if you see the path with SDK and NDK location then it’s ok to proceed skip the below part and if not then you need to setup the PATH before you execute the make and make install script in
To setup path use:-
$export PATH=/Users/<yourusername>/android-sdks/platform-tools/:/Users//android-sdks/tools/:/Users//Documents/ndk/:/nobackup/local/prog/nasm/bin/:$PATH
it’s like export PATH=(Path of your SDK platform tools folder):(Path of your SDK tools folder):(Path of your NDK folder):$PATH
This will set up the path and to confirm again run
$ echo $PATH
Now if the Path is already setup you can simply run
$ make
Now connect your Device to you Mac and see if eclipse has detected it. After the device is connected run:
$ make install
Now if everythink is OK:-
After you have made your build then now you can import it into your Android Studio.
Open Android Studio
Import Project (Eclipse,ADT,Gradle,etc.) > select linphone-android > OK

I am able to build the limphone on mac by follow the steps describe here :-
Linphone for android is not working/missing libraries

You definetely need these tools to build linphone.
Concerning nasm I had the same problem. You can use this site that instructs you how to upgrade to a newer nasm:
Instructions how to upgrade nasm
Concerning other useful tools you can install the tools below with this command:
$sudo port install coreutils automake autoconf libtool intltool wget pkgconfig cmake gmake yasm grep doxygen ImageMagick optipng antlr3
All these are found in the linphone build instructions README.md file.

Related

How to install Android sdk to Ubuntu 14.04?

I had download Android zip file from the web site developer.android.com
And I try to install like following command in Terminal.
#cd desktop/android-sdk/tools/
#./studio.sh
After this system shows the window with title Android SDK Manager
Is it the proper procedure to install?
You can use apt-get to install , its easier.
1st) Download the repository
sudo add-apt-repository ppa:paolorotolo/android-studio
2nd) Update
sudo apt-get update
3rd) install
sudo apt-get install android-studio
this will install a old version , you just have to update .
If you plan to run adb command you have to set the path on your .bashrc "OR" .profile.
export ANDROID_HOME=~/Android/Sdk
PATH=\$PATH:\$ANDROID_HOME:\$ANDROID_HOME/tools:\$ANDROID_HOME/platform-tools
export PATH
you can create a desktop entry form Android Studio , in case you don't find how to create you can create by creating a file:
/usr/share/applications/android-studio.desktop
inside this file add this lines
[Desktop Entry]
Version=1.0
Type=Application
Terminal=false
Name=Android Studio
Exec=/opt/android-studio/bin/studio.sh
Comment=Integrated Android developer tools for development and debugging.
Icon=androidstudio
Categories=GNOME;GTK;Development;IDE;
i create a script to do all this job but unfortunately i cant send it here.
PS: make sure you have the JAVA_HOME set .
How to install Android Studio in Ubuntu
Duplicate Question is why you are being voted down a simple google search of
android studio on ubuntu 14.04 top result is a referenced question that is protected here
Setting up Android Studio takes just a few clicks.
While the Android Studio download completes, verify which version of the JDK you have: open a command line and type javac -version. If the JDK is not available or the version is lower than 1.8, download the Java SE Development Kit 8.
To install Android Studio on Linux, proceed as follows:
Unpack the .zip file you downloaded to an appropriate location for
your applications, such as within /usr/local/ for your user profile,
or /opt/ for shared users.
To launch Android Studio, open a terminal, navigate to the
android-studio/bin/ directory, and execute studio.sh. Tip: Add
android-studio/bin/ to your PATH environment variable so you can
start Android Studio from any directory.
Select whether you want to import previous Android Studio settings
or not, then click OK.
The Android Studio Setup Wizard guides you though the rest of the
setup, which includes downloading Android SDK components that are
required for development.
Note: If you are running a 64-bit version of Ubuntu, you need to install some 32-bit libraries with the following command:
sudo apt-get install lib32z1 lib32ncurses5 lib32bz2-1.0 lib32stdc++6
If you are running 64-bit Fedora, the command is:
sudo yum install zlib.i686 ncurses-libs.i686 bzip2-libs.i686
Find the Instructions for install Android Studio for Linux from this link
All the information is there, yet feel free to ask anything.

Building Ionic app on UBUNTU for Android fails with exit code 2: Failed to find 'ANDROID_HOME'

I am using Ubuntu 14.04 version and im trying to work with ionic.
The error comes when I try to:
$ ionic start todo blank
$ cd todo
$ sudo ionic platform add android
$ sudo ionic build android
And I get the following error:
[Error: Failed to find 'ANDROID_HOME' environment variable. Try setting setting it manually.
Failed to find 'android' command in your 'PATH'. Try update your 'PATH' to include path to valid SDK directory.]
ERROR building one of the platforms: Error: /home/kelvin/Desktop/todo/platforms/android/cordova/build: Command failed with exit code 2
You may not have the required environment or OS to build this project
Error: /home/kelvin/Desktop/todo/platforms/android/cordova/build: Command failed with exit code 2
I know there is alot of sites with a answer to this question, but none of them gave me a fix. Or maybe they did, but I didnt understand it. I tried on this site building-ionic-app, but that didnt work either.
I followed this tutorial by Nic Raboy, and its still not working.
Install Android, Cordova, and Ionic Framework in Ubuntu.
So let me explain what I did and maybe that is helpfull to fix my problem:
I started with this guide: Ionic Framework Guide
To install Cordova, make sure you have Node.js installed, then run
Install Node.js
$ sudo apt-get install -y nodejs
$ node -v
v5.0.0
Install Cordova
$ sudo npm install -g cordova
Follow the Cordova platform guides for Android and iOS to make sure you have everything needed for development on those platforms.
Follow the Cordova platform guides for Android
I followed this guilde:
Complete installing guide for android SDK / ADT Bund on Ubuntu
My computer is 64-bit and since im using 14.04.
Step 2: install libgl1-mesa-dev:i386 package.
$ sudo apt-get install libgl1-mesa-dev:i386
Step 3: Install openjdk-6-jdk or better, openjdk-7-jdk
$ sudo apt-get install openjdk-7-jdk
Step 4: Download the Android SDK or the ADT Bundle from here and unzip it to wherever you want.
Then I follow step 4 on techtach Complete Guide
$ wget http://dl.google.com/android/android-sdk_r20-linux.tgz
$ wget http://dl.google.com/android/adt/22.6.2/adt-bundle-linux-x86_64-20140321.zip
Then I unzipped the adt-bundle and copied the folders from SDK -> /home/kelvin/android-sdk-linux/
The folders are: build-tools,extras,platforms,platform-tools,system-images,tools.
Then I executed the following command to install latest android updates
$cd ~/android-sdk-linux/tools
$sudo ./android
And installed
Android SDK Tools (24.0.2)
Android SDK Platform-tools (20)
ANDROID SDK Build-tools (19.0.3)
SDK Platform
ARM EABI V7a System Image
Android Support Library
And then open bashrc
$gedit ~/.bashrc
And added the following lines.
export PATH=${PATH}:~/android-sdk-linux/tools
export PATH=${PATH}:~/android-sdk-linux/platform-tools
export ANDROID_HOME=~/android-sdk-linux/tools
Checking if it is right:
$ANDROID_HOME
bash: /home/kelvin/android-sdk-linux/tools: Is a directory
Create the project & Configure Platforms
$ ionic start todo blank
$ cd todo
$ sudo ionic platform add android
$ sudo ionic build android
And I get the following error:
[Error: Failed to find 'ANDROID_HOME' environment variable. Try setting setting it manually.
Failed to find 'android' command in your 'PATH'. Try update your 'PATH' to include path to valid SDK directory.]
ERROR building one of the platforms: Error: /home/kelvin/Desktop/todo/platforms/android/cordova/build: Command failed with exit code 2
You may not have the required environment or OS to build this project
Error: /home/kelvin/Desktop/todo/platforms/android/cordova/build: Command failed with exit code 2
And now im kinda lost. I found a forum where they have the same problem: ANDROID_HOME is not set... and one of the guys suggested.
I finally solved it. It was on my users path but not the root users path. I have to run these commands as a root user. I had to edit my root users .bash_profile file.
and one of the others tells how:
In Ubuntu, do all the commands also root
sudo su
gedit ~/.bash_profile
export ANDROID_HOME=/root/Android/Sdk
export PATH=${PATH}:$ANDROID_HOME/tools:$ANDROID_HOME/platform-tools
But a third guy said this is a bad idea, so I didnt do it.
I can run the following command:
$ionic serve
And it runs in the browser, but I cant run for android.
I just read your question and it seems you followed the correct way.I faced the same situation during installation process.
The proper set up an Ubuntu machine for Ionic Framework Android development has many steps.Now there are a ton of options to handle this task, but not many bare bones solutions. Most solutions on the internet explain how to use an IDE, or fail to elaborate a complete installation.
After a research,I have found a nice tutorial by Nic Raboy.I followed this tutorial and everything is fine now.
Install Android, Cordova, and Ionic Framework in Ubuntu

Cordova error while adding android in mac

I'm working on a macbook and developing with cordova. Now, I want to create an Android apk, but, when I type cordova platform add android I get this:
Error: The command "android" failed. Make sure you have the latest Android SDK installed, and the "android" command (inside the tools/ folder) is added to your path.
Ok, this message should be very clear about what to do next, but don't know what to do. When I search I keep getting how to solve this in Windows and can't follow steps.
What (and how) should I do?
Thanks
EDIT:
I've already installed Android SDK when trying to compile apk.
More info:
As I couldn't install ANT, I uninstalled it: brew uninstall ant. But when brew install antagain I got:
$ brew install ant
==> Downloading http://www.apache.org/dyn/closer.cgi?path=ant/binaries/apache-ant-1.9.3-bin.tar.gz
==> Best Mirror http://apache.rediris.es/ant/binaries/apache-ant-1.9.3-bin.tar.gz
curl: (22) The requested URL returned error: 404 Not Found
Error: Failed to download resource "ant"
Download failed: http://apache.rediris.es/ant/binaries/apache-ant-1.9.3-bin.tar.gz
Some things to make sure you have completed before starting w/ Android:
Make sure ANT is installed:
Try ant --version, if command not found you need to install ANT.
The easiest way I have found is to use Homebrew. If you do not have homebrew installed, get it here
Once installed run
homebrew update
homebrew install ant
Unpack Android SDK:
Download and unpack the SDK package, place it in an easy to find location.
Then add the tools and platform-tools paths to your global PATH, like this:
vi ~/.bash_profile
add this line:
export PATH=/path/to/android/sdk/tools:/path/to/adnroid/sdk/platform-tools:$PATH
Exit the terminal and re open the terminal.
Now you should be able to run cordova platform add android in your project folder.

Error executing command 'ant' on Mac OS X 10.9 Mavericks when building for Android with PhoneGap/Cordova

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

NDK - Error trying to generate a build.xml file for Hello-jni

I just installed Android NDK, r5b, and while trying to follow the steps from Exploring the hello-jni Sample, on the command line I receive the error:
MacBook-2:~ mvermant$ cd ndk/samples/hello-jni
MacBook-2:hello-jni mvermant$ android update project -p . -s
-bash: android: command not found
I'm using Eclipse Helios release 2 with Android SDK r10 and ADT 10.0.0 on MAC 10.6.6. I have also checked to have GNU Make 3.81, and installed GNU Awk(though I am not sure it's in the right place).
I've searched a lot, and seems there might be a class path missing somewhere, but I can't figure out where exactly and what to do to fix it.
You should make sure the tools directory of your android-sdk is on your (shell) path.
Something like:
export PATH="/path/to/sdk/tools:$PATH"
before you execute your command.
In general you will also need two other directories to be on your path:
/path/to/sdk/platform-tools - for adb and other android sdk tools
/path/to/ndk - for ndk-build and ndk-gdb, which are ndk tools
You can also do some setup so that you don't have to run these commands every time you open Terminal.

Categories

Resources