Ubuntu 14.10 LTS 64-bits Environment using Android Studio

Source: Internet
Author: User

It's been about two months since Google released the official version of Android Studio 1.0. Having been accustomed to using the Eclipse+adt model, and having tried the Android Studio preview in Windows, I felt that the card was not working, and it was temporarily shelved. Today, it's a whim to know if using Android Studio under Linux will be smoother than Windows. Here are the basic building processes, as well as some of the problems encountered:
first, the installation of files
1.ubuntu 14.10 LTS 64-bits(Some library issues were encountered while running Android studio due to the use of the 64-bits operating system)
2.jdk-8u25-linux-x64.tar.gz(http://www.oracle.com/technetwork/java/javase/downloads/index.html)
3.Android-studio-ide-135.1641136-linux.zip(developer.android.com/index.html)
4.android-sdk_r24.0.2-linux.tgz(developer.android.com/sdk/index.html)

second, build the Java environment
I put all the installed files in the Documents folder.
1. Unzip and copy the JDK to the/usr/lib/java path:
CD ~/doucements
tar-zxf jdk-8u25-linux-x64.tar.gz
sudo cp-r ~/jdk1.8.0_25/usr/lib/java
2. Configure Environment variables
     sudo gedit ~/.profile
Add the following line at the end:
     Export java_home=/usr/lib/java/jdk1.8.0_25
Save and close, and then update with Source:
     Source ~/.profile
To view the value of Java_home in an environment variable:
     Env|grep Java_home
If displayed:
     java_home=/usr/lib/java/jdk1.8.0_25
Description successfully configured
3. Modify the system default JDK
     sudo update-alternatives--install/usr/bin/java java/usr/lib/java/jdk1.8.0_25/bin/java
Enter the number before the Sun JDK
sudo update-alternatives--install/usr/bin/javac javac/usr/lib/java/jdk1.8.0_25/bin/javac
sudo update-alternatives--config java
sudo update-alternatives--config javac
4. After doing this, check the current Java version:
     java-version
The feedback is as follows:
Java Version "1.8.0_25"
Java (TM) SE Runtime Environment (build 1.8.0_25-b17)
Java HotSpot (TM) 64-bit Server VM (build 25.25-b02, Mixed mode)
At this point, the JDK is installed successfully.
Third, Android Studio installation
Android Studio installation is relatively simple, as long as the decompression can be, I am accustomed to the home under the new software folder, used to store such software (most of the space in the installation of the system when assigned to/home).
Extract and copy Android studio and SDK to ~/software (method with JDK, no more)
At this point, you can open Android Studio by running the following command directly:
sudo ~/software/android-studio/bin/studio.sh
If you do not want to enter the command every time, you can create a new shortcut, create a new file on the desktop, named Android Studio.desktop, the following content modified path after the copy to save (exec Gksu best to keep, I did not add, in the same with Android Studio's start-up interface was face reading for half an hour before suddenly realizing that it was necessary to have permission.

[Desktop Entry]
name=android Studio
Encoding=utf-8
Exec=gksu ~/software/android-studio/bin/studio.sh
Icon=~//software/android-studio/bin/androidstudio.ico
startupnotify=true
Terminal=false
X-multipleargs=false
type=application
CATEGORIES=GTK; Utility; Terminalemulator;
nodisplay=true
X-ubuntu-gettext-domain=gksu
comment[en_us]=

The first time you run Android Studio will ask for standard or custom when installing, which can specify the directory of the SDK during installation. The author has already downloaded the Android-sdk-linux in advance, put in the ~/software path, so chose the latter, so save a lot of time. But even so, it was found that the installation was delayed. Speculation may be because there is still something to download, but the wall is high, but the walls are straight into the cloud, so download speed is slow, or not at all in the download. You have a good gauge, I have a wall ladder, the author finally chose to use modify HTTP proxy way to change natural moat as a thoroughfare, the method is as follows:
Under the Android-studio/bin directory, there is a file named Idea.properties, open the file and add it at the end
     disable.android.first.run=true
Turn off the First Run Setup wizard, reopen Android studio, and in file->settings you can see the HTTP Proxy, where you can place your wall ladder. (. PS SDK Manager's tools->options also has the same configurable place)
Remove the disable.android.first.run=true you just added and run Android studio again, which should be much faster.
Iv. New Construction and operation of the project
Or in the case of Hello World, in fact the whole new process is similar to Eclipse+adt, but the interface is somewhat different,
No more talking here. The first new process to download gradle, if the wall ladder is very stable, and generally will not be like online said that two hours, I feel the moment is good.
New project after the interface feel really want to look good, in fact, the entire layout will not make people feel too unfamiliar, feel quickly can use proficiency. Find these Android icons and run the icon to run Hello World.
In the menu bar you can clearly see three icons with Android robots, namely AVD Manager, SDK Manager and Android Device Manager. I updated the Android 5.0 API via SDK Manager, then clicked Open AvD Manager, click Create virtual device to create a new VM, here I cloned Nexus 6 API 21 directly in the last column of the list "Action You can see the green triangle icon running, click this to run the virtual machine. Actual test I found that there is no more than the other platform or faster than the eclipse, I do not know whether the author's computer configuration is not good or other aspects of the problem.
There is also a green Run button in the menu bar of Android Studio, and you can run Hello World directly by clicking on it. I encountered a lot of problems in the run, organized as follows:
1. At the very beginning, after clicking Run, the progress bar will pop up after a few moments:
       ADB not responding. You can wait More,or kill "Abd.exe" process manually and click ' Restart '
I found that there was no ADB running, and the ADB-dedicated port 5037 was not occupied. So I entered the ADB's path:
       CD ~/software/android-sdk-linux/platform-tools/
Then directly run ADB, it is strange that the path clearly has the ADB, but I ran after the prompt did not find the command, but I had to follow the hint in the path with Apt-get install the ADB, and then run Hello world!
2. The previous ADB error is no longer prompted, but the pop-up window still shows adb:error while loading shared Libraries:libstdc++.so.6:cannot open Shared object file. I think, this is good to do ah, so:
       sudo apt-get install lib32stdc++6
Did not expect to run again or not, still prompted similar lib related issues. I suddenly found this kind of hints are 32, but the author of the system is 64 Ah, Google is only based on the 32-bit to build? thus
       sudo apt-get install ia32-libs
Tips:
Package Ia32-libs are not available, but are referred to by the another package.
This may mean and the package are missing, has been obsoleted, or
is only available from another source
However the following packages replace it:
lib32z1 lib32ncurses5 lib32bz2-1.0
Three recommended options for installation:
       sudo apt-get install lib32z1 lib32ncurses5 lib32bz2-1.0
Run Hello world,bingo! again after installation is complete

Summary: The problems encountered throughout the process may be due to differences between 32-bit systems and 64-bit systems, and to verify that Android Studio is more fluent under Linux, the answer is no at the moment. However, if the author's notebook configuration and the use of the Ubuntu operating system itself has been made more bloated, such as the premise of consideration, this fluency problem is debatable. Later, after you are familiar with the IDE, continue logging.

Ubuntu 14.10 LTS 64-bits Environment using Android Studio

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.