You are attempting to build with the incorrect version of Java.

Source: Internet
Author: User

Android getting started (1) trial
Android version
Many Android versions include 0.9, 1.0, 1.5, 1.6, 2.0, and 2.1.
April 15 cupcake Android 1.5
September 15 donut Android 1.6: Linux kernel upgraded to 2.6.29. Support for CDMA, WVGA, and qvga
Supports opencore2 media engine and TTS
October 28 Android 2.0 eclair
Support HTML5
Revamped graphics architecture for improved performance that enables better hardware acceleration.
 
January 2010 Android 2.1 flan
Like features and 2.0, features mainly modify some buckets.

Android code
1 Installation Tool repo:
Curl http://android.git.kernel.org/repo> ~ /Bin/Repo
Chmod A + x ~ /Bin/Repo

2. Download the platform code
Put the code under/Media/h/android
1. Create a directory and put the code in it:

Mkdir android
CD android

2. Run repo init to download the latest source code:

Repo init-u git: // android.git.kernel.org/platform/manifest.git

3. When you are prompted to enter the name and e-mail address, enter the name and Gmail email address. The following message is displayed:

Repo initialized in/android

4 download

Repo sync
Notes: If you want to download code of another version, such as cupcake
Repo init-u git: // android.git.kernel.org/platform/manifest.git-B cupcake
Download eclair
Repo init-u git: // android.git.kernel.org/platform/manifest.git-B eclair

Android Compilation
HOST: Ubuntu 9.04
Java, javac version 1.6
(1) Source code compilation
The compilation is very simple and can be done directly in the android directory after 5 or 6 hours. However, the android compilation system requires Java, and the javac version is 1.5, in build/CORE/main. MK,
Java and javac versions are detected. If the version is incorrect, the following error occurs:

Checking build Tools versions...
**************************************** ********************
You are attempting to build with the incorrect version
Of Java.
 
Your version is: Java version "1.6.0 _ 0 ".
The correct version is 1.5.
 
Please follow the machine setup instructions
Http://source.android.com/download

Solution 1: Edit build/CORE/Main. mk

Modify

Java_version: = $ (shell Java-Version 2> & 1 | head-N 1 | grep '["] 1/. 5 [/." $]')

Javac_version: = $ (shell javac-Version 2> & 1 | head-N 1 | grep '["] 1/. 5 [/." $]')

Is

Java_version: = $ (shell Java-Version 2> & 1 | head-N 1 | grep '["] 1/. 6 [/." $]')

Javac_version: = $ (shell javac-Version 2> & 1 | head-N 1 | grep '["] 1/. 6 [/." $]')

Disadvantage: problems still occur during SDK compilation.
Make SDK
Docs droiddoc: Out/target/common/docs/services
Javadoc: Error-in the doclet droiddoc class, java. Lang. Reflect. invocationtargetexception has been thrown by the method start.
Com. Sun. Tools. javac. Code. symbol $ completionfailure: the class file of sun. util. Resources. openlistresourcebundle is not found.

Solition 2: Install JDK of version 1.5:

$ Sudo apt-Get install sun-java5-jdk flex
$ Sudo Update-Java-alternatives-s Java-1.5.0-sun

(2) SDK Compilation
After compiling the source code, execute make SDK.
Under the out/host/linux-x86/SDK
Android-sdk_eng.lawrencekang_linux-x86 android-sdk_eng.lawrencekang_linux-x86.zip sdk_deps.mk

Simulator running
Now you have set environment variables.
Export Path = $ path:/Media/h/Android/out/host/ linux-x86/bin
Export android_product_out =/Media/h/Android/out/target/product/generic
Export android_swt =/Media/h/Android/out/host/linux-x86/
Then execute emulator
Usage:
1. Run the simulator with the default Virtual Device
Emulator
2. Run with a certain skin
QVGA-L for emulaor-skin
Emulator-skin wvga800 uses the wvga800 skin to run the simulator.
However, the following information is displayed:
Emulator: emulator window was out of view and was recentred
We can solve this problem through the-scale option. For our WVGA skin, it is okay to start the simulator with./emulator-skin WVGA-scale 0.9.
3. Specify the size directly.
Emulator-skin 800x480

However, Google's website http://developer.android.com/has the following example:
The
Android SDK includes several emulator skins that you can use to control
The resolution and density of the emulated device's screen. to select
Specific skin for running the emulator, create an AVD that uses that
Skin. Please do not use deprecated emulator options such as-skin
Control the skin used by an emulator instance. For more information
About avds, see Android Virtual Devices.
It means it is better not to use-skin to run the simulator, but to use-AVD.
The tool used to create AVD is Android.
Android
Problem:
Error: Error parsing the SDK.
Error:/Media/h/androidcupcake/out/host/linux-x86/platforms is missing.
Error: Unable to parse SDK content.

But in the out/host/linux-x86/SDK/android-sdk_eng.lawrencekang_linux-x86/tools directory./android can
Originally in the out/host/linux-x86/SDK/android-sdk_eng.lawrencekang_linux-x86/below the platforms directory, visible android will find
Platforms directory under the upper-level directory
Copy platforms and add-ons to the out/host/linux-x86
Then run Android.
Place the created avd in ~ /. Android/AVD
If a foo is created, emulator-AVD foo

After the simulator runs, you can use the ADB shell to execute terminal commands.

Related Article

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.