I need to modify Chromium for Android. Because I have little or no experience with Linux, I've been having difficulties with getting it to compile and now I'm stumped for good.
I've been following the steps here: https://code.google.com/p/chromium/wiki/AndroidBuildInstructions
This is roughly a list of commands that I have executed on a fresh Ubuntu 13.04 (raring) installation:
sudo apt-get install git-svn subversion g++ gtk+-2.0 gyp ant
# here I download depot_tools into the home dir
git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git
export PATH="$PATH"\:`pwd`/depot_tools
# here I download the Chromium source code into ~/src
fetch android --nosvn=True
sudo ./src/build/install-build-deps.sh
gclient sync --nohooks
# download "jdk-6u38-linux-x64.bin" from the Oracle website, then
chmod 755 ~/Downloads/
sudo mkdir /usr/lib/jvm
cd /usr/lib/jvm && sudo /bin/sh ~/Downloads/jdk-6u38-linux-x64.bin -noregister
sudo update-alternatives --install /usr/bin/javac javac /usr/lib/jvm/jdk1.6.0_38/bin/javac 50000
sudo update-alternatives --install /usr/bin/java java /usr/lib/jvm/jdk1.6.0_38/bin/java 50000
sudo update-alternatives --install /usr/bin/javaws javaws /usr/lib/jvm/jdk1.6.0_38/bin/javaws 50000
sudo update-alternatives --install /usr/bin/javap javap /usr/lib/jvm/jdk1.6.0_38/bin/javap 50000
sudo update-alternatives --config javac
sudo update-alternatives --config java
sudo update-alternatives --config javaws
sudo update-alternatives --config javap
export JAVA_HOME=/usr/lib/jvm/jdk1.6.0_38
export PATH=$JAVA_HOME/bin\:"$PATH"
unset CC
unset CXX
cd ~/src
./build/android/envsetup.sh
# edit install-build-deps-android.sh
# replacing "ant1.8" with "ant" (a hack of mine)
sudo ./build/install-build-deps-android.sh
export GYP_DEFINES="target_arch=x64"
Now I'm missing android_gyp and I can't find it anywhere in the ~/src folder.
This is where it says I should execute it:
http://code.google.com/p/chromium/wiki/AndroidBuildInstructions#Compile
If I try to skip the command, it says that I don't have "build.ninja", so yeah...
Could anyone please help me? I'm new at this.
Thank you
./build/android/envsetup.sh
Should be:
. build/android/envsetup.sh
The dot + space sources the script so that any bash definitions will be kept around after the script runs. See: http://ss64.com/bash/source.html.
android_gyp is a bash function defined in envsetup.sh, so sourcing it provides the definition in your shell.
Related
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
I try to install android studio on ubuntu machine. I download android studio zip file from here. I run /android-studio/bin$ sh studio.sh command on terminal, it says that OpenJDK 6 is not supported. Please use Oracle Java or newer OpenJDK. To fix this problem, I run sudo apt-get install openjdk-7-jre. But this way cannot solve my problem. What should I do?
try to install ORACLE JAVA 8 IN UBUNTU VIA PPA, this for ubuntu 15.04, 14.10, 14.04, 12.04 and 10.04
sudo add-apt-repository ppa:webupd8team/java
sudo apt-get update
sudo apt-get install oracle-java8-installer
EDIT:
This command will give you a list of alternative java options, which you will then be able select a JDK instead of JRE:
sudo update-alternatives --config java
first install java by using these commands.
wget --header "Cookie: oraclelicense=accept-securebackup-cookie" http://download.oracle.com/otn-pub/java/jdk/8u25-b17/jdk-8u25-linux-x64.tar.gz
sudo mkdir /opt/jdk
sudo tar -zxf jdk-8u25-linux-x64.tar.gz -C /opt/jdk
sudo update-alternatives --install /usr/bin/java java /opt/jdk/jdk1.8.0_25/bin/java 100
sudo update-alternatives --install /usr/bin/javac javac /opt/jdk/jdk1.8.0_25/bin/javac 100
now these steps will install Android studio
sudo add-apt-repository ppa:paolorotolo/android-studio
sudo apt-get update && sudo apt-get install android-studio
sudo /opt/android-studio/bin/studio.sh
this will do.
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
I got the following error while compiling android source code for the first time on Ubuntu 12.04, I have not chenged the source code at all abd suggested command in error "make update-api" didn't help me
repo sync
source build/envsetup.sh
lunch full-eng
make
http://pastebin.com/5gEjkTLV
As the problem is in the java part here is my java installation information. I downloaded jdk-6u39-linux-x64.bin and run it and copy the file into /usr/lib/jvm/jdk1.6.0_39/ and set the this java as the main java application by :
sudo update-alternatives --install "/usr/bin/java" "java" "/usr/lib/jvm/jdk1.6.0_39/bin/java" 1
sudo update-alternatives --install "/usr/bin/javac" "javac" "/usr/lib/jvm/jdk1.6.0_39/bin/javac" 1
sudo update-alternatives --install "/usr/bin/javaws" "javaws" "/usr/lib/jvm/jdk1.6.0_39/bin/javaws" 1
sudo update-alternatives --config java
sudo update-alternatives --config javac
sudo update-alternatives --config javaws
here is the result:
echo $JAVA-HOME
/usr/lib/jvm/jdk1.6.0_39/
java -version
java version "1.6.0_39"
Java(TM) SE Runtime Environment (build 1.6.0_39-b04)
Java HotSpot(TM) 64-Bit Server VM (build 20.14-b01, mixed mode)
javac
javac 1.6.0_39
Look at the dump again. you need to regenerate api/current.txt. You need to run make update-api to regenerate that file. You should be able to build again after that .
******************************
You have tried to change the API from what has been previously approved.
To make these errors go away, you have two choices:
1) You can add "#hide" javadoc comments to the methods, etc. listed in the
errors above.
2) You can update current.txt by executing the following command:
make update-api
To submit the revised current.txt to the main Android repository,
you will need approval.
******************************
I tried installing Android Studio on a Samsung Chromebook Series 3 with an ARM processor, but I'm stuck with the Java. Any help would be appreciated.
Downloaded and extracted Android Studio
Downloaded and extracted Java 1.7.0_21 JDK ARM
Completed the below commands except the javaws commands as they error-ed out doesn't exist
tar xzvf ~/Downloads/jdk-7u21-linux-arm.tar.gz sudo mv jdk1.7.0_21/ /usr/lib/jvm/
sudo update-alternatives --install /usr/bin/java java /usr/lib/jvm/jdk1.7.0_21/bin/java 1
sudo update-alternatives --install /usr/bin/javac javac /usr/lib/jvm/jdk1.7.0_21/bin/javac 1 sudo update-alternatives --install /usr/bin/javaws javaws /usr/lib/jvm/jdk1.7.0_21/bin/javaws 1
sudo update-alternatives --config java
sudo update-alternatives --config javaws
I tried the JAVA_HOME=/usr/lib/jvm/jdk1.7.0_21 command and it would still give me the error.
Please check whether your system configuration is 32bit or 64bit and according to that download respective JDK and provide its path in JAVA_HOME
No It's not in the studio. What you should do:
Change your JRE to use the JRE found inside your JDK
Add tools.jar that can be found in the JDK Libraries folder
That's it. It's a known issue, but they're working on it. But this is a workaround.
Couple of things, you can check:
1. check jdk is in your path
2. from your command line, execute this command: java -version
and see what it shows
3. and execute this command: javac -version
If both command gives no error then try again otherwise fix those issue.btw, Do not forget to check your system configuration to make sure that it is 32bit or 64 bit