The self-compiled Android SDK cannot identify Platform Problems of different versions.

Source: Internet
Author: User

Today, the Android 2.3 source code, gingerbread, is compiled. The source code is obtained through "Repo init-u git: // android.git.kernel.org/platform/manifest.git-B gingerbread.

After the compilation is complete, start sdkmanager and find that the compiled Android-2.3 cannot be found in "installed packages ".

Go to the compilation result directory out/host/linux-x86/SDK/android-sdk_eng.cmoaciopm _Linux-x86/toolsWhy can't sdkmanager detect Android-2.3?

I checked the sdkmanager source code and finally found the problem.

Sdkmanager source code is stored in SDK/Sdkmanager contains three projects

1. app: Main Interface and interface logic of sdkmanager

2. lib/sdklib: core logic of sdkmanager

3. lib/sdkuilib: Sub-UI component code of sdkmanager


Sdkmanager. reloadsdk () is the method for detecting installed packages. The detection standards are as follows:

1. Verify the build. Prop file,
Obtain apiname from Ro. Build. version. Release
Obtain apinumber from Ro. Build. version. SDK
Obtain apicodename (optional) from Ro. Build. version. codename)
2. Verify source. Properties
PKG. Revision
Not Required
3. Verify SDK. Properties
Not Required
4. Verify that the key files in the platforms/[SDK-Version]/directory exist
Android. Jar
Framework. aidl
Tools/aapt
Tools/aidl
Tools/dx
Tools/lib/dx. Jar

The reason why sdkmanager cannot detect install packages is finally found. The SDK directory structure compiled by the Android Gingerbread source code is inconsistent with the sdkmanager detection logic.

Android adjusted the SDK directory structure in 2.3 and moved the Tools Folder under platform to the SDK root directory, the name is platform-tools (which contains the aapt and ADB tools of the platform. In this way, platform is unified in all operating systems. You do not need to publish different platforms for different operating systems, but only release different platform-tools ).

It can be seen that the sdkmanager code in the gingerbreak code branch is not "latest" and is not consistent with the compiled SDK directory structure. When Google makes a mistake, such a large project can be understood.

After learning about the above facts, I made a soft link, cheated sdkmanager, and restarted to check that everything was normal.


PS: Android-SDK directory's andriod command under the tools, specify the-V parameter to Display Error and warniNGThrough this parameter, you can view the sdkmanager warning and error logs.



This article Reprinted from: http://blog.csdn.net/cmoaciopm/article/details/6710243

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.