Establishing Android Build Enviroment under openSuse Leap

Search This thread

aZuZu

Inactive Recognized Developer
Jan 19, 2011
638
941
40
Zagreb
Tutorial how set up Android Build Enviroment on openSUSE Leap

If this help's u hit Thanks! :)

1) If you don’t have fresh installed openSUSE Leap first you need remove all Java installation, many people might have the wrong version of Java installed.
Code:
sudo zypper remove openjdk-* icedtea-* icedtea6-*
Follow the on-screen instructions to remove any stray Java versions. Otherwise, move on to the next step.

2) Install the main build tools with this command:
Code:
sudo zypper install bison curl flex git gnupg gperf libesd-devel liblz4-1_4 ncurses-devel libSDL-devel python-wxWi dgets-devel libxml2-2 libxml2-tools lzop java-1.7.0-openjdk java-1.7.0-openjdk-devel schedtool squashfs libxslt1 zip zlib-devel make gcc-c++

Appendx A to 2:
To setup maven which is needed for building:

1. Download maven:
wget http://mirrors.ibiblio.org/apache/maven/maven-3/3.3.9/binaries/apache-maven-3.3.9-bin.tar.gz

2. Extract the file
tar -xvzf apache-maven-3.3.9-bin.tar.gz /tmp

3. Move to /opt/ folder
sudo mv /tmp/apache-maven-3.3.9 /opt/

4. Update environment, cd to home directory
cd ~
nano .bashrc

5. Append the path
export PATH=$PATH:/opt/apache-maven-3.3.9/bin

6. Reload
source .bashrc

7. Verify maven
mvn --version

Appendix B to 2:
For 64-bit system also install:
sudo zypper install glibc-devel-32bit ncurses-devel-32bit readline-devel-32bit libz1-32bit

>> build-essential << is Ubuntu meta package which in openSUSE is devel_basis
And u can install it by command
sudo zypper install --type pattern devel_basis
Select y to what it is offering to install.

3) Repo install...
mkdir ~/bin && curl http://commondatastorage.googleapis.com/git-repo-downloads/repo > ~/bin/repo && chmod a+x ~/bin/repo

Appendix to 3:
To fix repo sync u will need install this:
sudo zypper install libpth20-32bit
maybe this to:
sudo zypper install openjdk-8-devel

4) Use your favorite text editor to open ~/.bashrc - I like nano:
Code:
nano ~/.bashrc

By default nano is not installed so install it by command:
sudo zypper install nano

5) At the very bottom (use the Page Down key) paste this code to a new line:
Code:
export PATH=~/bin:$PATH
export USE_CCACHE=1

6) Save it. In nano that would be Ctrl-O and then Enter. Then Ctrl-X to exit back to a prompt. Restart bash:
Code:
source ~/.bashrc

7) In the terminal, navigate to where you would like to download the Android source code. The commands below will make it in your home folder.
Code:
mkdir ~/android
cd ~/android

8) Now you're going to initialize the repo. This is where you decide the flavor of Android you want to build, i.e. AOKP, CyanogenMod, AOSP etc.

For the purposes of this tutorial, here's the command for Cyanogenmod 13 (Marshmallow) :
Code:
repo init -u https://github.com/CyanogenMod/android.git -b cm-13.0

9) Time to get the source, many gigabytes of downloading await.
Don't worry, it's automated. It's the last one!
Code:
repo sync
Check back periodically every hour or so. It all depends on how fast your connection is.

That's it! Everything should be ready to go.
 
Last edited:

dani020110

Senior Member
Mar 30, 2015
284
211
Lima
Thanks for the guide :D
In Tumbleweed, the package is liblz4-1_7
There is a typo, it should be python-wxWidgets-devel
Also, the link to repo should be complete:
Code:
http://commondatastorage.googleapis.com/git-repo-downloads/repo
 
  • Like
Reactions: andrerodr

_mone

Inactive Recognized Developer
Jul 25, 2015
950
2,898
London
Android Build Enviroment for openSUSE tumbleweed early 2019

Sorry for necromancing this old thread, but I've recently switched to openSUSE and these are the dependencies that I've used to successfully build LineageOS-16.0.:
Code:
sudo zypper install --type pattern devel_basis
sudo zypper install bison java-1_8_0-openjdk java-1_8_0-openjdk-devel SDL-devel python-wxWidgets-devel lzop schedtool squashfs glibc-devel-32bit ncurses-devel-32bit ncurses5-devel-32bit readline-devel-32bit ccache libz1-32bit python-xml bc

You can find maven here:
https://software.opensuse.org/package/maven
and android-tools here:
https://software.opensuse.org/package/android-tools

Dependencies already included by default in my system (not included in "devel_basis") that may you don't have but you need:
Code:
gpg2 liblz4-1 libxml2-2 libxml2-tools libxslt-tools zip

Just sharing because this post will (probably) save some time to someone in the same situation in early 2019.
 

dipole

Senior Member
Sep 1, 2010
404
68
Sorry for necromancing this old thread, but I've recently switched to openSUSE and these are the dependencies that I've used to successfully build LineageOS-16.0.:
Code:
sudo zypper install --type pattern devel_basis
sudo zypper install bison java-1_8_0-openjdk java-1_8_0-openjdk-devel SDL-devel python-wxWidgets-devel lzop schedtool squashfs glibc-devel-32bit ncurses-devel-32bit ncurses5-devel-32bit readline-devel-32bit ccache libz1-32bit python-xml bc

You can find maven here:
https://software.opensuse.org/package/maven
and android-tools here:
https://software.opensuse.org/package/android-tools

Dependencies already included by default in my system (not included in "devel_basis") that may you don't have but you need:
Code:
gpg2 liblz4-1 libxml2-2 libxml2-tools libxslt-tools zip

Just sharing because this post will (probably) save some time to someone in the same situation in early 2019.

Thanks for this. I'm still getting an error and wondering what SSL packages you have installed? I'm obviously missing one below.
EDIT: i kept installing SSL packages until it worked, can't remember which one did the trick but it seems it's chugging along now

/run/media/david/4d58d760-2359-46fb-b95b-1b374cb34428/android/lineage/kernel/oneplus/sdm845/scripts/extract-cert.c:21:10: fatal error: openssl/bio.h: No such file or directory
#include <openssl/bio.h>
^~~~~~~~~~~~~~~
compilation terminated.
make[2]: *** [scripts/Makefile.host:101: scripts/extract-cert] Error 1
make[2]: *** Waiting for unfinished jobs....
make[1]: *** [/run/media/david/4d58d760-2359-46fb-b95b-1b374cb34428/android/lineage/kernel/oneplus/sdm845/Makefile:558: scripts] Error 2
make[1]: Leaving directory '/run/media/david/4d58d760-2359-46fb-b95b-1b374cb34428/android/lineage/out/target/product/fajita/obj/KERNEL_OBJ'
make: *** [Makefile:152: sub-make] Error 2
make: Leaving directory '/run/media/david/4d58d760-2359-46fb-b95b-1b374cb34428/android/lineage/kernel/oneplus/sdm845'
[ 0% 70/94167] //external/protobuf:aprotoc clang++ src/google/protobuf/compiler/javanano/javanano_extension.cc [linux_glibc]
ninja: build stopped: subcommand failed.
12:41:48 ninja failed with: exit status 1
 
Last edited:

Top Liked Posts

  • There are no posts matching your filters.
  • 8
    Tutorial how set up Android Build Enviroment on openSUSE Leap

    If this help's u hit Thanks! :)

    1) If you don’t have fresh installed openSUSE Leap first you need remove all Java installation, many people might have the wrong version of Java installed.
    Code:
    sudo zypper remove openjdk-* icedtea-* icedtea6-*
    Follow the on-screen instructions to remove any stray Java versions. Otherwise, move on to the next step.

    2) Install the main build tools with this command:
    Code:
    sudo zypper install bison curl flex git gnupg gperf libesd-devel liblz4-1_4 ncurses-devel libSDL-devel python-wxWi dgets-devel libxml2-2 libxml2-tools lzop java-1.7.0-openjdk java-1.7.0-openjdk-devel schedtool squashfs libxslt1 zip zlib-devel make gcc-c++

    Appendx A to 2:
    To setup maven which is needed for building:

    1. Download maven:
    wget http://mirrors.ibiblio.org/apache/maven/maven-3/3.3.9/binaries/apache-maven-3.3.9-bin.tar.gz

    2. Extract the file
    tar -xvzf apache-maven-3.3.9-bin.tar.gz /tmp

    3. Move to /opt/ folder
    sudo mv /tmp/apache-maven-3.3.9 /opt/

    4. Update environment, cd to home directory
    cd ~
    nano .bashrc

    5. Append the path
    export PATH=$PATH:/opt/apache-maven-3.3.9/bin

    6. Reload
    source .bashrc

    7. Verify maven
    mvn --version

    Appendix B to 2:
    For 64-bit system also install:
    sudo zypper install glibc-devel-32bit ncurses-devel-32bit readline-devel-32bit libz1-32bit

    >> build-essential << is Ubuntu meta package which in openSUSE is devel_basis
    And u can install it by command
    sudo zypper install --type pattern devel_basis
    Select y to what it is offering to install.

    3) Repo install...
    mkdir ~/bin && curl http://commondatastorage.googleapis.com/git-repo-downloads/repo > ~/bin/repo && chmod a+x ~/bin/repo

    Appendix to 3:
    To fix repo sync u will need install this:
    sudo zypper install libpth20-32bit
    maybe this to:
    sudo zypper install openjdk-8-devel

    4) Use your favorite text editor to open ~/.bashrc - I like nano:
    Code:
    nano ~/.bashrc

    By default nano is not installed so install it by command:
    sudo zypper install nano

    5) At the very bottom (use the Page Down key) paste this code to a new line:
    Code:
    export PATH=~/bin:$PATH
    export USE_CCACHE=1

    6) Save it. In nano that would be Ctrl-O and then Enter. Then Ctrl-X to exit back to a prompt. Restart bash:
    Code:
    source ~/.bashrc

    7) In the terminal, navigate to where you would like to download the Android source code. The commands below will make it in your home folder.
    Code:
    mkdir ~/android
    cd ~/android

    8) Now you're going to initialize the repo. This is where you decide the flavor of Android you want to build, i.e. AOKP, CyanogenMod, AOSP etc.

    For the purposes of this tutorial, here's the command for Cyanogenmod 13 (Marshmallow) :
    Code:
    repo init -u https://github.com/CyanogenMod/android.git -b cm-13.0

    9) Time to get the source, many gigabytes of downloading await.
    Don't worry, it's automated. It's the last one!
    Code:
    repo sync
    Check back periodically every hour or so. It all depends on how fast your connection is.

    That's it! Everything should be ready to go.
    1
    Thanks for the guide :D
    In Tumbleweed, the package is liblz4-1_7
    There is a typo, it should be python-wxWidgets-devel
    Also, the link to repo should be complete:
    Code:
    http://commondatastorage.googleapis.com/git-repo-downloads/repo
Our Apps
Get our official app!
The best way to access XDA on your phone
Nav Gestures
Add swipe gestures to any Android
One Handed Mode
Eases uses one hand with your phone