Precautions for compiling Android 2.2 source code

Source: Internet
Author: User

For Android 2.2For source code compilation, you must pay attention to the following issues:For Android 2.2The content of the source code compilation.For Android 2.2For more information, see this article.

Android 2.2 compilation, from the source code directly make OK. 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 /.

Compile the sdk after compilation,

 
 
  1. cd ~/android/src   
  2. . build/envsetup.sh   
  3. lunch sdk-eng   
  4. make sdk 

Note that JDK 5 is required for compiling the doc in Android 2.2 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 out the ALL_DOCS + =$ (full_target) line in the build \ core \ droiddoc. mk file to add # To the line ).

You can use JDK to compile the source code and JDK to compile the sdk. However, you still need to comment out the file build \ core \ droiddoc. ALL_DOCS + = $ (full_target) in 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)


 
Android 2.2 sdk compiled OK, In the ou/host/linux-x86 directory under the sdk directory generated. The content is similar to the sdk downloaded from the Internet. Click to enlarge it)

Install the ADT plug-in of Eclipse. Android 2.2 sdk requires at least 0.96 ADT. You are compiling the Android 2.2 sdk. Do not use the 8.0 adt that has been officially upgraded. This will cause the simulator not recognized in eclipse. In addition, jdk is required when installing the ADT plug-in... 6_21 my colleague reported a null pointer exception when it was 6_15. If you reinstall jdk, update the environment variables such as java_home ).

In this case, an error occurs during compilation of the new Android 2.2 Project. 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.

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

1. Use lunch to change the configuration:

 
 
  1. cd ~/android/src   
  2. . build/envsetup.sh   
  3. lunch sdk-eng   
  4. make sdk 

Summary:For Android 2.2The content of the source code compilation should be paid attention to several issues.For Android 2.2The learning of source code compilation content can be helpful to you!

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.