1. compilation in a 32-bit System
If you need to compile the Android system in a 32-bit system, you need to modify some makefiles before compilation.
First, modify build/CORE/Main. mk. The modified content is as follows:
-Ifneq (64, $ (findstring 64, $ (build_arch )))
+ Ifneq
(I686, $ (findstring i686, $ (build_arch )))
$ (Warning
**************************************** ********************)
$ (Warning you are attempting to build on a 32-bit system .)
$ (Warning only 64-bit build environments are supported beyond froyo/2.2 .)
Modify the following four files:
external/clearsilver/cgi/Android.mkexternal/clearsilver/java-jni/Android.mkexternal/clearsilver/util/Android.mkexternal/clearsilver/cs/Android.mk
# This forces a 64-bit build for Java6-LOCAL_CFLAGS += -m64-LOCAL_LDFLAGS += -m64+LOCAL_CFLAGS += -m32+LOCAL_LDFLAGS += -m32
Change local_cflags and local_ldflags from-M64 to-M32 to specify a 32-bit System for compilation.
If 64-bit operating system compilation is used, you do not need to modify these settings, but remember to install them:
For 64-bit servers the following extra packages may be needed:
"sudo apt-get install libc6-dev-i386" (libc6-dev-amd64 if AMD CPU)
"sudo apt-get install g++-multilib lib32ncurses5-dev lib32z1-dev"
Jdk64bit version Compilation
2. Build/CORE/base_rules.mk: 128: *** frameworks/opt/emoji/JNI:
... Libgl2jni already defined by framwworks/base/OpenGL/tests/gl2_jni/JNI stop
From the compilation rules:
# Make sure that this is_host/class/module combination is unique.
Module_id: = module. $ (if \
$ (Local_is_host_module), host, target). $ (local_module_class). $ (local_module)
Ifdef $ (module_id)
$ (Error $ (local_path): $ (module_id) already defined by $ (module_id )))
Endif
Android. mk defined in framwworks/base/OpenGL/tests/gl2_jni/is as follows:
Local_module: = libgl2jni
Include $ (build_shared_library)
This is wrong because the generated dynamic library is repeated. You can modify the tests directory and do not participate in compilation. the most direct way is to delete the framwworks/base/OpenGL/tests/gl2_jni folder.
3. aidl compilation reports why couldn't find import for class
"The aidl service only supports a limited number of data types. Therefore, if you use the aidl server to transmit some complex data, you need to perform further processing. The aidl Service supports the following data types:
Java's simple class type (INT, Char, Boolean, etc ). Import is not required ). String and charsequence. Import is not required ).
List and map. Note that the element types of list and map objects must be data types supported by aidl. Import is not required ). The API automatically generated by aidl. Import is required ).
Class that implements the Android. OS. parcelable interface. Import is required ).
The latter two data types need to be imported using import, and the methods for passing values of data types that do not require import are the same. The steps to pass a value of the data type to be imported (for example, to implement the class of the android. OS. parcelable Interface) are slightly complicated. In addition to creating a class that implements the Android. OS. parcelable interface, you also need to create an aidl file for this class and define it using the parcelable keyword ."
My parcelable aidl file is not found because local_aidl_includes + = xxx is not added.
Modify build/CORE/pathmap. mk in the root directory of the android source code to add your directory, and then make Update-API
4. The @ override error method always prompts that the method of the parent class is not overwritten.
If JDK is used for compiling, the @ override method will not overwrite its parent class. In fact, this method is a method in the interface implemented by the class,
However, jdk1.6 of this syntax can be passed below, that is to say, jdk1.6 thinks that class override methods and implementation interface methods are called override, while jdk1.5 does not
I think so. I don't know if this is the bug of JDK, or if I thought that covering the parent class method is different from implementing the interface method, I don't know. However
From the OO perspective, override can be considered as covering the parent class method and implementing the interface method, because they all have the same purpose, both for reuse and are a type of polymorphism.
Representation.
Change the JDK version to 1.6.
5. An error occurred while compiling the Alsa-lib library.
The following error occurs during compilation when the Alsa-lib library is transplanted to Android system development.
/Tmp/cckyar40.s: assembler messages:
/Tmp/cckyar40.s: 2763: Error: Selected processor does not support 'Mrs IP, cpsr'
/Tmp/cckyar40.s: 2764: Error: unshifted register required -- 'orr R2, IP, #128'
/Tmp/cckyar40.s: 2765: Error: Selected processor does not support 'msr cpsr_c, r2
A compilation error is reported. The selected processor does not support the MRS and MSR commands.
The original arm command has two command modes: 32-bit and 16-bit. The 16-bit is the thumb instruction set, and the Code Compiled by the thumb Instruction Set occupies less space,
And the efficiency is high. Therefore, the arm compiler of Android uses the thumb mode by default. The problem is that the Alsa Code contains some content.
The following error is reported only when the 32-bit command is used. The modification method is simple. Add the following content to Android. mk:
Local_arm_mode: = arm
In the android compilation system, the value of the local_arm_mode variable is arm or thumb, which represents the 32-bit and 16-bit arm instruction sets. The default value is thumb.
Prebuilt/linux-x86/toolchain/arm-eabi-4.4.0/bin /.. /lib/GCC/ARM-Eabi/4.4.0 /.. /.. /.. /.. /ARM-Eabi/bin/ld: failed to set dynamic Section Sizes: Bad Value
Collect2: LD returned 1 exit status
Make: *** [out/target/product/MERLIN/obj/shared_libraries/libasound_intermediates/linked/libasound. So] Error 1
Solve this problem by removing the following macro definitions in the Alsa-lib/include/config. h file:
# Define versioned_symbols
Many errors have been encountered during the development process. I will record them one by one later, and some will be forgotten ..
Compile in Android. mk:
Include $ (clear_vars)
$ (Call add-prebuilt-files, static_libraries, libyfcdca.)
The prompt must be defined: local_module_tags: = optional. The general modification method is:
Macro definition variables in build \ core \ definitions. mk:
Define include-prebuilt
Include $ (clear_vars)
Local_src_files: = $ (1)
Local_built_module_stem: = $ (1)
Local_module_suffix: =$ $ (suffix $(1 ))
Local_module: =$ $ (basename $(1 ))
Local_module_class: = $ (2)
Include $ (build_prebuilt)
Endef
Add local_module_tags: = optional
However, this requires modifying the android source code. If it is not your own Android system, it will be troublesome to do so, so you must try other solutions:
# Include $ (clear_vars)
# $ (Call add-prebuilt-files, static_libraries, libyfcdca.)
Include $ (clear_vars)
Local_src_files: = libyfcdca.
Local_built_module_stem: = libyfcdca.
Local_module_suffix: = lib
Local_module: = yfcdca
Local_module_class: = static_libraries
Local_module_tags: = optional
Include $ (build_prebuilt)
That's all.