Failed to build gem native extension when installing Calabash Android on Ubuntu - android

I want to install Calabash Android on Ubuntu(13.10). I have gem (1.8.23) and ruby (1.9.3p194) installed and tried to run "sudo gem install calabash-android" but keep getting messages saying "Failed to build gem native extension", below is the full messages:
Building native extensions. This could take a while...
ERROR: Error installing calabash-android:
ERROR: Failed to build gem native extension.
/usr/bin/ruby1.9.1 extconf.rb
/usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in require': cannot load such file -- mkmf (LoadError)
from /usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:inrequire'
from extconf.rb:1:in `'
Gem files will remain installed in /var/lib/gems/1.9.1/gems/gherkin-2.12.2 for inspection.
I tried "sudo apt-get update" but it didn't fix the issue. And I also checked gcc so it shouldn't be build issue. Does anyone have any suggestions? Thanks in advance!

While installing ruby, select development version or full version, so on my system with ubuntu 12.04, i would use
sudo apt-get install ruby1.9.1-full
also please make sure android home path and ant path is proper
Thanks

You can use rbenv that manage perfectly ruby gems versions like nvm does for node.js:
$ sudo apt-get update
$ sudo apt-get install git-core curl zlib1g-dev build-essential libssl-dev libreadline-dev libyaml-dev libsqlite3-dev sqlite3 libxml2-dev libxslt1-dev libcurl4-openssl-dev python-software-properties libffi-dev
$ git clone git://github.com/sstephenson/rbenv.git .rbenv
$ echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bashrc
$ echo 'eval "$(rbenv init -)"' >> ~/.bashrc
$ git clone git://github.com/sstephenson/ruby-build.git ~/.rbenv/plugins/ruby-build
$ echo 'export PATH="$HOME/.rbenv/plugins/ruby-build/bin:$PATH"' >> ~/.bashrc
$ git clone https://github.com/sstephenson/rbenv-gem-rehash.git ~/.rbenv/plugins/rbenv-gem-rehash
$ sudo apt-get install rbenv
$ exec $SHELL
$ rbenv install 2.2.2
$ rbenv global 2.2.2
$ ruby -v
$ echo "gem: --no-ri --no-rdoc" > ~/.gemrc
$ gem install bundler

Related

Installation of QARK in ubuntu 18.04

I've tried to install QARK in my Ubuntu 18.04 Desktop machine. I was following some docs provided by Linked In but it has not worked for me.
Prerequisite
Python 2.7.17-1
pip 9.0.1
openjdk version "10.0.2" 2018-07-17 (java home environment variable hast to be set)
Download QARK from github
$ git clone https://github.com/linkedin/qark
$ cd qark
$ pip install -r requirements.txt
$ python setup.py install
To test APK :
$ sudo qark --apk path/to/my.apk
It will take some time, the html report will be generating on the following path
/home//.local/lib/python2.7/site-packages/qark/report/report.html

Boilerplate Ignite for Android using React Native on a Linux Platform

I am trying to integrate Boilerplate for Android using React Native on Ubuntu 16.04 but i don't know where to start and what to do next .
So far I did the steps below :
1)Install React-Native on Linux Platform
1. Install NodeJs and npm:
$sudo apt install curl
$curl -sL https://deb.nodesource.com/setup_8.x | sudo -E bash –
$sudo apt-get install -y nodejs
Check the version of nodejs:
$node -v
Or
$nodejs -v
Check the version of npm:
$npm -v
Install the create-react-native-app:
$sudo npm install -g create-react-native-app
Create the first project:
$create-react-native-app MyFirstProject
Move to the project directory using:
$cd MyFirstProject/
Using the next command, the development server will start:
$npm start
2)I installed Java:
$sudo add-apt-repository ppa:webupd8team/java
$sudo apt-get update
$sudo apt-get install oracle-java8-installer
$sudo apt-get install oracle-java8-set-default
3)I installed Android :
Downloaded “All Android Studio Packages” archive from:
https://developer.android.com/sdk/index.html
Extract the archive file into an appropriate location:
$sudo unzip android-studio-ide-141.2178183-linux.zip -d /opt
Lunch Android:
$./studio.sh.
The next steps would be to open the Android SDK Manager within Studio and install the API version you're targeting and any System images you'll like to run in order to get an emulator (assuming you're not using a physical device)
You'll also need to set ANDROID_HOME environment variable so React knows where the Android build tools are
For example, edit your bash profile
export ANDROID_HOME=$HOME/Android/Sdk
export PATH=$PATH:$ANDROID_HOME/tools
export PATH=$PATH:$ANDROID_HOME/platform-tools
Your SDK would be under /opt, possibly
Eventually, run your code with react-native run-android

Buildozer on kivy-example fails to build apk

I've installed kivy (on debian jessie / python 2.7), and the examples work fine,
sudo dpkg --add-architecture i386
sudo apt-get update
sudo apt-get install -y build-essential ccache git zlib1g-dev python2.7 python2.7-dev
sudo apt-get install libc6-i386 lib32stdc++6 lib32gcc1 lib32ncurses5
sudo pip install colorama appdirs sh jinja2 six
sudo pip install --upgrade colorama
sudo apt-get install pkg-config autoconf automake libtool
sudo apt-get install software-properties-common
sudo apt-get install cython #installs 0.21.1
sudo add-apt-repository ppa:kivy-team/kivy
sudo apt-get update
sudo apt-get install python-kivy python-kivy-examples #installs 1.8.0
sudo chmod -R 777 /usr/share/kivi-examples/ #install made it Read-Only Root
sudo pip install --upgrade buildozer #installs 0.32
sudo easy_install buildozer #just in case?
sudo pip install python-for-android #0.4?
java -version #reports 1.8.0_121
but when I try to buildoze any of the kivy-examples it has an error. I've set the log_level = 2 in the .spec file, but I don't see anything in the console output that suggests what could be the problem
/usr/share/kivy-examples/demo/touchtracer$ buildozer init
...
/usr/share/kivy-examples/demo/touchtracer$ buildozer -v android debug
/usr/share/kivy-examples/demo/touchtracer$ buildozer -v android_new debug
Error: A JNI error has occurred, please check your installation and try again
Exception in thread "main" java.lang.NoClassDefFoundError: com/android/utils/ILogger
at java.lang.Class.getDeclaredMethods0(Native Method)
at java.lang.Class.privateGetDeclaredMethods(Class.java:2701)
at java.lang.Class.privateGetMethodRecursive(Class.java:3048)
at java.lang.Class.getMethod0(Class.java:3018)
at java.lang.Class.getMethod(Class.java:1784)
at sun.launcher.LauncherHelper.validateMainClass(LauncherHelper.java:544)
at sun.launcher.LauncherHelper.checkAndLoadMain(LauncherHelper.java:526)
Caused by: java.lang.ClassNotFoundException: com.android.utils.ILogger
at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
... 7 more
# Command failed: /home/guest/.buildozer/android/platform/android-sdk-20/tools/android list sdk -u -e
#
# Buildozer failed to execute the last command
# The error might be hidden in the log above this error
Also, at some point while I was trying to build, it was downloading the android sdk every time I ran buildozer, but now that stopped.. or at least it's not not getting to that point anymore.
Is it possible that upgrading to python 3 then installing python3-kivy will solve this? I noticed my current install did not grab the latest (kivy 1.9.1 / android sdk 21)
[Update #1] I installed newer versions of buildozer (.33dev), cython (25.2), and kivy (1.9.2.dev0)
cd ~
git clone https://github.com/kivy/buildozer.git
cd buildozer
sudo python setup.py install
cd ..
sudo pip install Cython==0.25.2 #kivy 1.9.2.dev0 required Cython >= 0.23
git clone https://github.com/kivy/kivy
cd kivy
sudo python setup.py install
and updated the .spec file :
requirements = python2,kivy==master
android.sdk = 24
but still no luck. The only other thing I could find to try is to downgrade java8 to java7. Does buildoze not work with 8?
Buildozer command failed
[Update #2] I uninstalled Java8 ( https://askubuntu.com/questions/84483/how-to-completely-uninstall-java ) and installed Java 1.7.0_80 but I get the same exact error
sudo apt-get install oracle-java7-installer
java -version
sudo apt-get install oracle-java7-set-default
sudo update-alternatives --config java
BuilDozer is obsolete as of now. Forget it. I am stuck with it as asked here: Buildozer gives error upon building Pong app of Kivy framework for android publishing
Try Python for Android or QPython

How to install and run appium in linux?

I want to do UI automation for opening an url in a real android device. For that I want to install and run appium on my linux system, please guide me how to do? Also suggest me Is there anyway to open an url in chrome browser using eclipse??
Install appium on Linux 18.04
If you have node.js installed you can try :
sudo npm install -g appium --unsafe-perm=true --allow-root
it worked for me.
I guess all the information you need to run Appium in Linux is in this here:
http://appium.io/docs/en/about-appium/getting-started/
how to run your test
http://appium.io/slate/en/master/?ruby#running-tests
and a bunch of sample code here
https://github.com/appium/sample-code
and if you want to run your test in Chrome Browser you will need Chromedriver, it's already integrated in the appium project. More info here:
https://sites.google.com/a/chromium.org/chromedriver/getting-started
Install Appium on Linux(Fedora 22)
$ sudo dnf update -y
$ sudo dnf groupinstall -y "Development Tools"
$ sudo dnf install -y autoconf automake libtool gettext git scons cmake flex bison libcurl-devel curl ncurses-devel ruby bzip2-devel expat-devel
$ git clone https://github.com/Homebrew/linuxbrew.git ~/.linuxbrew
Until LinuxBrew is fixed, the following is required.
Add to .bashrc:
export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig:/usr/local/lib64/pkgconfig:/usr/lib64/pkgconfig:/usr/lib/pkgconfig:/usr/lib/x86_64-linux-gnu/pkgconfig:/usr/lib64/pkgconfig:/usr/share/pkgconfig:$PKG_CONFIG_PATH
## Setup linux brew
export LINUXBREWHOME=$HOME/.linuxbrew
export PATH=$LINUXBREWHOME/bin:$PATH
export MANPATH=$LINUXBREWHOME/man:$MANPATH
export PKG_CONFIG_PATH=$LINUXBREWHOME/lib64/pkgconfig:$LINUXBREWHOME/lib/pkgconfig:$PKG_CONFIG_PATH
export LD_LIBRARY_PATH=$LINUXBREWHOME/lib64:$LINUXBREWHOME/lib:$LD_LIBRARY_PATH
$ ln -s $(which gcc) ~/.linuxbrew/bin/gcc-4.4
$ ln -s $(which g++) ~/.linuxbrew/bin/g++-4.4
$ brew update
$ brew install node # get node.js
$ npm install -g appium # get appium
$ npm install wd # get appium client
$ appium & # start appium
Hello appium installation is very simple , please check below steps
1)Install Latest Node.js
curl -sL https://deb.nodesource.com/setup_8.x | sudo -E bash -
sudo apt-get install -y nodejs
More information please check official website : https://nodejs.org/en/download/package-manager/
2) Install latest Appium
npm install -g appium
or
sudo npm install -g appium
More information please check official documentation :
https://www.npmjs.com/package/appium
install on nvm
sudo apt install build-essential checkinstall
sudo apt install libssl-dev
curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.31.0/install.sh | bash
node -v
npm -v
npm install -g appium

How to setup Appium in Ubuntu for android

I am new in appium(automation testing technology).
I'm using a PC running Ubuntu Linux.
I have searched about this topic but I have not got any useful tutorial. Can anyone point me to the right documentation?
Do not install nodejs through apt-get, which will need sudo rights and appium will not work if node is installed as sudo user. If you have already installed remove it using
sudo apt-get remove nodejs
sudo apt-get remove npm
Download latest nodejs linux binaries form http://nodejs.org/download/
Extract into a folder that doesn't need sudo rights to access, for example your home folder.
tar -xvf <downloaded_binary_tar.gz>
Add the following line to your ~/.bashrc file.
export PATH=$PATH:<full_path_of_the_extracted_node_folder>/bin
Open a now terminal and do
npm install -g appium
appium
I'm sure you will find plenty of tutorials on this (and this will only work for android since you would need an OSX box to do iOS) but here is what we did:
Install nodejs/npm:
sudo apt-get update
sudo apt-get install -y python-software-properties python g++ make
sudo add-apt-repository ppa:chris-lea/node.js
sudo apt-get update
sudo apt-get install nodejs
UPDATE: use homebrew to install node
Install grunt-cli:
npm install -g grunt-cli
If you run into an issue about it not being able to install in a directory, do this.
Install Appium:
npm install -g appium
Set up a symlink in your .bashrc file for Appium:
ln -s /path/to/appium.js /usr/bin/appium
Test to make sure it can run by running appium in your terminal. The output should be something like:
info: Welcome to Appium v0.16.0 (REV 292d265edd9c7aaf96f165009285c814b218363d)
info: Appium REST http interface listener started on 0.0.0.0:4723
info - socket.io started
Install Java JRE 6
sudo apt-get install openjdk-6-jre
Install Android SDK:
Download the SDK and extract it to your home folder.
Launch the Android SDK Manager:
~/path/to/android-sdk/tools/android
Install the packages that you'll need in the new window:
Android 4.X
Android Support Library
Android SUpport Repository
Google Play services
Everything under Tools
Everything under Extras
You can also create a symlink for the Android SDK Manager by doing:
ln -s /path/to/android-sdk/tools/android /usr/bin/android
Steps to get appium working on ubuntu pc :
Install ruby: Paste the below command at terminal and hit enter
sudo apt-get install build-essential curl git m4 ruby texinfo libbz2-dev libcurl4-openssl-dev libexpat-dev libncurses-dev zlib1g-dev
Install linux brew:Paste the below command at terminal and hit enter
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/linuxbrew/go/install)"
set path for brew
Type: gedit .bashrc at terminal and copy paste following into the .bashrc file
export PATH="$HOME/.linuxbrew/bin:$PATH"
export MANPATH="$HOME/.linuxbrew/share/man:$MANPATH"
export INFOPATH="$HOME/.linuxbrew/share/info:$INFOPATH"
Install node:Paste the below commands one by one at terminal and hit enter
brew update
brew install node
brew link node
Install appium
npm install -g appium
npm install wd
To start appium: Paste the below command at terminal and hit enter
appium
Just to save somebodies time: on my Ubuntu 14.04 I was trying to install npm both via sudo apt-get and using binaries. Both approaches were wrong but everything is Ok after I istalled npm via HomeBrew
Steps to install Appium on Linux.
Basics setup from the link.
Now install linuxbrew taking help from the link.
Now use the following commands from the terminal
Make sure to start a new terminal:
brew update
brew install node
brew link node
npm install -g appium#version
Hope this helps those who face the issue installing with "sudo".
Many people face issue while installing appium on ubuntu because we install using sudo we should install appium using npm
Detailed step by step explanation to install appium on Ubuntu using npm
CLICK HERE
To install node.js and appium without sudo we use linuxbrew.
To install linuxbrew these are the dependencies
Ruby 1.8.6 or newer
GCC 4.2 or newer
Git 1.7.12.4 or newer
Linux 2.6.16 or newer
64-bit x86 or 32-bit ARM platform
Install Ruby using below command
sudo apt-get install build-essential curl git m4 python-setuptools ruby texinfo libbz2-dev libcurl4-openssl-dev libexpat-dev libncurses-dev zlib1g-dev
Install Linux Brew using below command
ruby -e “$(curl -fsSL
https://raw.githubusercontent.com/Homebrew/linuxbrew/go/install)"
Set Path for brew
first type sudo gedit.bashrc in terminal and copy the below in the .bashrc file.export
PATH="$HOME/.linuxbrew/bin:$PATH"exportMANPATH="$HOME/.linuxbrew/share/man:$MANPATH"export INFOPATH="$HOME/.linuxbrew/share/info:$INFOPATH"
7 .Install Node:Open new terminal and copy the command and press enter
brew update
brew install node
brew link node
8.Finally Install Appium using below command
npm install -g appium
9.Let's Check if the installation is successfull. Open the terminal and type "appium" and hit enter.You should see something like this in the terminal
info: Welcome to Appium v1.4.12(REV 8db2d00b9afcf2c50a09a80a2e8d56b05a902caf)
info: Appium REST http interface listener started on 0.0.0.0:4723
info: Console LogLevel: debug
It is very simple and easy, Please check the below steps!.
1) Install latest Node.js
Terminal commands:
curl -sL https://deb.nodesource.com/setup_8.x | sudo -E bash -
sudo apt-get install -y nodejs
More information please check official website.
2) Install latest Appium
Terminal commands :
npm install -g appium
or
sudo npm install -g appium
More information please check official documentation.
I've installed the NVM on CentOS 7 and it works perfectly.
curl https://raw.githubusercontent.com/creationix/nvm/v0.13.1/install.sh | bash
I will strongly recommend going for that with which you will have control of NodeJS versions.
Btw, Linuxbrew doesn't work for me.
I can tell about the 14.04 version
Download the file from https://nodejs.org/en/
2.Now for extracting the file path press
Ctrl+l , it will give the exact path , copy it
3.open bash.src file and it has to be open with gedit, this file is hidden
Press Ctrl+h to see the hidden files
4.now in the bash.src file,paste the below commands
export PATH=$PATH:"somepath u copied upto bin"
export NODE_PATH=$PATH:"somepath u copied upto bin node_modules'"
It will surely work

Categories

Resources