Saturday, March 15, 2014

fedora 19 64 bit android development

To develop Android apps on Fedora 19 64 bit environment follow the below steps:

  1. Download Android bundle from http://developer.android.com. This downloads /home/jay/Downloads/adt-bundle-linux-x86_64-20131030.zip. This bundle contains "Eclipse IDE" and "Android SDK with 4.4 kitkat framework".
  2. Extract the downloaded zip file to your home directory. For me I've extracted it to /home/jay resulting in /home/jay/adt-bundle-linux-x86_64-20131030. After extracting the folder structure should look like below:

    [root@localhost jay]# ls -l ./adt-bundle-linux-x86_64-20131030
    total 8
    drwxrwxrwx.  9 jay jay 4096 Mar 16 08:37 eclipse
    drwxrwxrwx. 11 jay jay 4096 Mar 16 00:24 sdk
     
  3.  Give read/write/execute permissions:

    [root@localhost jay]# chmod -R 777 ./
  4. Run /home/jay/adt-bundle-linux-x86_64-20131030/sdk/tools/android to install few more frameworks (default the dowloaded SDK comes with 4.4 kitkat) 4.0.x IceCreamSandwitch. Having lower version frameworks allows you to check backward compatibility of the newly developed apps.
  5. Run /home/jay/adt-bundle-linux-x86_64-20131030/eclipse/eclipse. Create new eclipse workspace for android projects /home/jay/android-workspace
  6. In Eclipse Go to "Windows->Preferences". Expand list of Options under "Android" item in the left menu. When you select each option Eclipse shouldn't display any kind of "no such file or directory" dialog box. We've already given 777 permission to read/write/execute for all the files under "/home/jay/" so that both "Eclipse" and "Android SDK" have enough permissions and you won't be facing any kind of error.
  7. In Eclipse Go to "File->new->AndroidApplicationProject". Fill the Dialogs properly. This creates new project. Remember even 777 permissions helps in creating a project without errors.
  8. In Eclipse Go to "Window->Android Virtual Device Manager". Create new AVD. While creating new AVD I faced a problem "[2014-03-16 08:40:03 - SDK Manager] Failed to create sdcard in the AVD folder." To resolve this you need to install few 32bit libraries. While installing those 32 bit libraries I found a conflicting alsa-lib-1.0.27.1-2.fc19.x86_64 64 bit library. Then I removed this library without removing any other dependent libraries on alsa-lib-1.0.27.1-2.fc19.x86_64. Run the below commands. (Reference http://www.if-not-true-then-false.com/2010/android-sdk-and-eclipse-adt-on-fedora-centos-red-hat-rhel/)

    [root@localhost jay]# rpm -e --nodeps alsa-lib-1.0.27.1-2.fc19.x86_64
    [root@localhost jay]# yum install libX11.i686 libXext.i686 libao.i686 alsa-lib.i686 libX11-devel.i686

    Now I am able to create new AVD.
  9. Try to build the application. If you see the error "aapt: error while loading shared libraries: libz.so.1: cannot open shared object file: No such file or directory", run the command:
    [root@localhost jay]# yum install zlib.i686
  10. if you see the error "error libGL.so: cannot open shared object file: No such file or directory" (reference http://stackoverflow.com/questions/18507812/which-libgl-to-use-for-android-emulator-in-fedora-64-bit)

    [root@localhost jay]# yum install glibc.i686 glibc-devel.i686 libstdc++.i686 zlib-devel.i686 ncurses-devel.i686 libX11-devel.i686 libXrender.i686 libXrandr.i686
    [root@localhost jay]# rpm -e --nodeps mesa-libGL-9.2-0.12.20130610.fc19.x86_64
    [root@localhost jay]# yum install mesa-libGL.i686

No comments:

Post a Comment

Followers