Notes for Android2.2 source code compilation

Source: Internet
Author: User

 

  1. Compile and make the source code directly.JDK 6 is required!The compilation time varies depending on the machine configuration. I spent about two hours compiling this time. The compiled file is under your source code directory/out /.

  2. Compile the sdk after compilation,

Cd ~ /Android/src
. Build/envsetup. sh
Lunch sdk-eng
Make sdk

Note that JDK 5 is required for compiling a doc in the sdk! I have introduced many methods on the Internet. I have used direct comments (that is, I skipped the doc compilation method ). This eliminates the need to replace the jdk version in the development environment. The specific method is: Comment the fileALL_DOCS + = $ (full_target) in build \ core \ droiddoc. mkYou can (add # In front of this line ). For more information, see http://yueguc.javaeye.com/blog/805895. (Update on. In this way, JDK is used for compiling the source code and JDK is used for compiling the sdk, but the file still needs to be commented out.ALL_DOCS + = $ (full_target) in build \ core \ droiddoc. mk. I did this with two jdk versions: Go to the sun official website and download the jdk1.5 and 1.6 installation packages, specify the environment variables such as JDK_HOME JRE_HOME in/etc/profile. When you want to switch the version, write the path of the corresponding version in the environment variables here, and then enter the source profile, check the version of java-version. It may take effect after restart.)

  1. After the sdk is compiled, the sdk directory is generated under the ou/host/linux-x86 directory of 1. The content is similar to the sdk downloaded from the Internet.

  2. Install the ADT plug-in of Eclipse. For android2.2The sdk must at least0.96. You have compiled 2.2 sdks. Do not use the 8.0 adt that has been officially upgraded. It will appear in eclipse that you cannot recognize the simulator. (Updated on 2010/12/10) And when installing the ADT plug-in, jdk needs jdk... 6_21 (my colleague named 6_15 reported a null pointer exception. If you reinstall jdk,Update environment variables such as java_home.).

  3. At this time, the compilation of the new 2.2 Project will fail. Unableto get buffer of resource assetfile. Is similar to the preceding error... There are also many solutions online. I adopted the direct method: overwrite the resource. arsc In the android. jar package. The resource. arsc file can be copied to the android. jar file of the sdk under win, and then pasted directly to the compiled android. jar file. For details about the cause, refer to http://blog.csdn.net/winner82/archive/2009/09/24/4589660.aspx.

The solution is to set the product as sdk when building the sdk. There are two methods:

1. Use lunch to change the configuration:

Cd ~ /Android/src
. Build/envsetup. sh
Lunch sdk-eng
Make sdk

    Notes on Android2.2 source code compilation-Simoncook is a programmer-blog

    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.