jami-docs

Forked version of Jami documentation, see wrycode.com/jami-docs-demo
git clone git://git.wrycode.com/wrycode/jami-docs.git
Log | Files | Refs

android.md (3794B)


      1 # Building Jami on Android
      2 
      3 + Please make sure Android SDK and NDK are installed, and their paths
      4 are properly set. If you need more information, please visit
      5 <https://github.com/savoirfairelinux/ring-client-android>
      6 + These instructions are for Ubuntu, check equivalent if you use a different distribution
      7 
      8 ## Prepare environment
      9 
     10 -   Install Java JDK 7 or 8 (Oracle or OpenJDK)
     11 
     12 <http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html>
     13 
     14 ```bash
     15 sudo apt install openjdk
     16 ```
     17 
     18 <!-- -->
     19 
     20 -   Install Android Studio:
     21 	<https://developer.android.com/studio/index.html>
     22 
     23 	You can install all dependecies like ndk (side by side), lldb with android-studio in settings > appearance & behavior > system settings > android sdk > sdk tools
     24 
     25 <!-- -->
     26 
     27 -   Install the Android NDK:
     28 	<https://developer.android.com/ndk/downloads/index.html>
     29 
     30 <!-- -->
     31 
     32 -   Install required tools
     33 
     34 <!-- -->
     35 
     36 ```bash
     37 sudo apt install autoconf automake libtool autopoint swig python
     38 ```
     39 
     40 Add these variables to your bash profile:
     41 
     42 ```bash
     43 export JAVA_HOME=<path_to_java_JDK>
     44 export ANDROID_HOME=<path_to_root_folder_sdk>
     45 export ANDROID_SDK=$ANDROID_HOME
     46 export ANDROID_NDK=<path_to_root_folder_ndk>
     47 export ANDROID_NDK_ROOT=$ANDROID_NDK
     48 export PATH=$PATH:$ANDROID_HOME/tools:$ANDROID_HOME/platform-tools:$ANDROID_NDK:$JAVA_HOME/bin
     49 ```
     50 
     51 ie for Ubuntu :
     52 
     53 ```bash
     54 export JAVA_HOME=/usr/lib/jvm/java-1.8.0-openjdk-amd64/jre/
     55 export ANDROID_HOME=/home/{username}/Android/Sdk
     56 export ANDROID_SDK=/home/{username}/Android/Sdk
     57 export ANDROID_NDK_ROOT=/home/{username}/Android/Sdk/ndk-bundle/
     58 export ANDROID_NDK=/home/{username}/Android/Sdk/ndk-bundle/
     59 export PATH=$PATH:$ANDROID_HOME/tools:$ANDROID_HOME/platform-tools:$ANDROID_NDK:$JAVA_HOME/bin
     60 ```
     61 
     62 ## Build and install locally
     63 
     64 -   Clone whole project repository
     65 
     66 <!-- -->
     67 
     68 ```bash
     69 git clone --recurse-submodules https://review.jami.net/ring-project
     70 ```
     71 
     72 -   Initialize project
     73 
     74 <!-- -->
     75 ```bash
     76 cd ring-project
     77 ./make-ring.py --init --distribution=Android
     78 ```
     79 
     80 
     81 -   Compile
     82 
     83 <!-- -->
     84 
     85 ```bash
     86 ANDROID_ABI="armeabi-v7a arm64-v8a" ./make-ring.py --install --distribution=Android
     87 ```
     88 
     89 **Output**: You can find the *.apk* file in the
     90 *./client-android/ring-android/app/build/outputs* folder.
     91 
     92 **Errors**
     93 - ```configure: error: source directory already configured; run "make distclean" there first```
     94 
     95 	It means you build for another distro like x86_64-pc-linux-gnu and builds are conflicting. The simpliest solution is to make another ring-project only for Android to avoid this conflict.
     96 
     97 ## Troubleshooting
     98 
     99 -   Check case in your sdk path. Since api 26,
    100 	/home/user/Android/**s**dk have become /home/user/Android/**S**dk
    101 
    102 <!-- -->
    103 
    104 -   You can check each path with *echo*. e.g : echo $JAVA\_HOME
    105 
    106 <!-- -->
    107 
    108 -   `sudo` will use root's bash profile. And you don't need it.
    109 
    110 <!-- -->
    111 
    112 -   If build fails, you can try to clean contribs with:
    113 
    114 ```bash
    115 cd ring-project/ && git clean -xdf
    116 cd ../daemon && git clean -xdf
    117 ```
    118 
    119 - Makeinfo issue
    120 	makeinfo: command not found
    121 	WARNING: 'makeinfo' is missing on your system.
    122 	**Solution**:   Install texinfo package containing makeinfo dep.
    123 
    124 <!-- -->
    125 
    126 - Unable to locate tools.jar
    127 	**Solution**:   Your java installation is not pointing to a JDK.
    128 					Install one, or make JAVA_HOME point to it.
    129 
    130 <!-- -->
    131 
    132 - When building the apk error in build-tools
    133 	error while loading shared libraries: libstdc++.so.6
    134 	**Solution**:   Install lib32stdc++6 lib32z1-dev
    135 
    136 <!-- -->
    137 
    138 - When compiling on Fedora
    139 	error while loading shared libraries: libtinfo.so.5: cannot open shared object file: No such file or directory
    140 	**Solution***: sudo dnf install ncurses-compat-libs
    141 
    142 <!-- -->
    143 
    144 - When building, you may get a Gradle error. You should install Gradle 5.4.1 by running apt-get install or installing directly on android-studio.